Kod: Kodu kopyalamak için üzerine çift tıklayın!
# config ##########################
set radiochans "#Radyo"
set adminchans "#Radyo@"
set streamip "*****"
set streamport "******"
set streampass "*******"
set scstatstrigger "!durum"
set scstreamtrigger "!link"
set sclistenertrigger "!dinleyici"
set scplayingtrigger "!calan"
set scdjtrigger "!dj"
set scsetdjtrigger "!setdj"
set scwishtrigger "!wish"
set scgreettrigger "!greet"
set sticarichattsongstrigger "!eski"
set schelptrigger "!help"
set ::rawcount 0
set announce "1"
set tamadres "http://Radyo.Biskrem.Net:1675/listen.pls"
set urltopic "1"
set tellsongs "1"
set tellusers "1"
set tellbitrate "1"
set advertise "1"
set offlinetext "8,1 »º» 0Biskrem-Fm Müzik Yayınımız Şuan 4KAPALI"
set offlinetopic "15!14,14!3,1 '9-<<--7<4@ 13,1 Biskrem-Fm Müzik Yayınımız Şuan 6,1 KAPALI 4,1@7>9-->>-3,1' 14,14!15,15i"
set onlinetext "8,1 »º» 0,1 Biskrem-Fm Müzik Yayınımız Şuan 9,1 AÇIK 0,1 Dinlemek için 8,1 http://Radyo.Biskrem.Net:1675/listen.pls"
set onlinetopic "15!14,14!3,1 '9-<<--7<4@ 0Biskrem-Fm Müzik Yayınımız Şuan 9AÇIK 0Dinlemek için 8http://Radyo.Biskrem.Net:1675/listen.pls 4@7>9-->>-3,1' 14,14!15,15i"
set streamtext "8,1 »º» 0,1Biskrem-Fm Müzik Yayınımız'ı dinlemek için >> 9,1http://Radyo.Biskrem.Net:1675/listen.pls"
set onadvertisetext "8,1 »º» 11,1Biskrem-Fm Müzik Yayınımız Şuan0 AÇIK 11dinlemek için 4,1 >> 8,1 http://Radyo.Biskrem.Net:1675/listen.pls"
set ofadvertisetext "8,1 »º» 11,1Biskrem-Fm Müzik Yayınımız Şuan14 KAPALI 11Radyo Linkimiz 4,1 >> 8,1 http://Radyo.Biskrem.Net:1675/listen.pls"
# end of config #####################
bind pub - $scstatstrigger pub_scstat
bind msg - $scstatstrigger msg_scstat
bind pub - $scplayingtrigger pub_playing
bind msg - $scplayingtrigger msg_playing
bind pub - $scdjtrigger pub_dj
bind msg - $scdjtrigger msg_dj
bind pub D $scsetdjtrigger pub_setdj
bind msg D $scsetdjtrigger msg_setdj
bind pub - $scwishtrigger pub_wish
bind msg - $scwishtrigger msg_wish
bind pub - $scgreettrigger pub_greet
bind msg - $scgreettrigger msg_greet
bind pub - $scstreamtrigger pub_stream
bind msg - $scstreamtrigger msg_stream
bind pub - $sticarichattsongstrigger pub_lastsongs
bind msg - $sticarichattsongstrigger msg_lastsongs
bind pub - $sclistenertrigger pub_listener
bind msg - $sclistenertrigger msg_listener
bind pub - $schelptrigger pub_help
bind msg - $schelptrigger msg_help
bind time - "* * * * *" isonline
bind time - "?0 * * * *" advertise
bind nick D * djnickchange
listen 3333 all
proc shrink { calc number string start bl} { return [expr [string first "$string" $bl $start] $calc $number] }
proc poststuff { mode text } {
global radiochans
foreach chan [channels] {
if {$radiochans == "" } { putquick "$mode $chan :$text" }
if {$radiochans != "" } {
if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} {putquick "$mode $chan :$text"}
}}}
proc schelp { target } {
global scstatstrigger scstreamtrigger scplayingtrigger scdjtrigger sticarichattsongstrigger scwishtrigger scgreettrigger sclistenertrigger
putserv "PRIVMSG #Radyo 12~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
putserv "PRIVMSG #Radyo :7Mevcut Komutlar :"
putserv "PRIVMSG #Radyo :12 $scstatstrigger 11-14 $scstreamtrigger 11-7 $sclistenertrigger 4- $scdjtrigger 5- $sticarichattsongstrigger 6- $scwishtrigger 2- $scgreettrigger 3- $scplayingtrigger11-13!istek2 Sanatci parca mesaj"
putserv "PRIVMSG #Radyo 11+12~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~11+"
}
proc pub_help {nick uhost hand chan arg} {
global radiochans
if {$radiochans == "" } { schelp $nick }
if {$radiochans != "" } {
if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { schelp $nick}
}}
proc advertise { nick uhost hand chan arg } {
global onadvertisetext onadvertisetext advertise streamip streamport streampass ofadvertisetext
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
}}
if { $streamstatus == "1" && $advertise == "1" } { poststuff privmsg $onadvertisetext }
if { $streamstatus != "1" && $advertise == "1" } { poststuff privmsg $ofadvertisetext }
}}
proc setdj {nickname djnickname } {
if {$djnickname == "" } { set djnickname $nickname }
global streamip streamport streampass
putlog "shoutcast: new dj: $djnickname ($nickname)"
set temp [open "dj" w+]
puts $temp $djnickname
close $temp
set temp [open "djnick" w+]
puts $temp $nickname
close $temp
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
}}
if { $streamstatus == "1" } { poststuff privmsg "\00308,01 »
º»\00309 Şuan Dj :\00311 $djnickname -\00309 Güzel vakit geçirmeniz dileğiyle.. \00308 »ºº«" } else {
putquick "privmsg $nickname :this has not been announced because the radio is currentlfy offline." }
}}
proc listener { target } {
global streamip streamport streampass
putlog "shoutcast: $target requested listener count"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]
set curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]
set maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]
set avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]
}}
close $sock
putserv "PRIVMSG #Radyo 8,1 »º» 9Çalan Parça : $playon 8»ºº« "
}}
proc msg_listener { nick uhost hand arg } { global radiochans; listener $nick }
proc pub_listener { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { listener $nick }}
proc wish { nick arg } {
if {$arg == ""} { putquick "notice $nick :4İsteğinizi belirtmeyi unuttunuz."; return 0}
global streamip streamport streampass
putlog "shoutcast: $nick wants to hear: $arg"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
set stitle [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
}}
if { $streamstatus == "1" } {
putlog "$stitle :(İSTEK) - $nick - $arg"
putquick "privmsg $stitle :(İSTEK) - $nick - $arg"
} else {
putquick "notice $nick :Özür Dileriz.. Şuan Biskrem-Fm Müzik Yayınımız Kapalı.." }
}}
proc msg_wish { nick uhost hand arg } { global radiochans; wish $nick $arg }
proc pub_wish { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { wish $nick $arg }}
proc sticarichattsongs { target } {
global streamip streamport streampass
putlog "shoutcast: $target requested songhistory"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set songs [string range $bl [string first "<TITLE>" $bl] [expr [string last "</TITLE>" $bl] + 7]]
regsub -all "<" $songs "<" songs
regsub -all ">" $songs ">" songs
regsub -all "&" $songs "+" songs
regsub -all """ $songs "\"" songs
regsub -all "'" $songs "'" songs
regsub -all "ÿ" $songs "" songs
regsub -all "<TITLE>" $songs " (" songs
regsub -all "</TITLE>" $songs ")" songs
regsub -all "<SONG>" $songs "" songs
regsub -all "</SONG>" $songs " " songs
regsub -all "<PLAYEDAT>" $songs "" songs
regsub -all "</PLAYEDAT>" $songs "" songs
regsub -all "" $songs "ç" songs
regsub -all "ý" $songs "ı" songs
regsub -all "Ö" $songs "Ö" songs
regsub -all "Ü" $songs "Ü" songs
regsub -all "ö" $songs "Ö" songs
regsub -all "ü" $songs "ü" songs
regsub -all "" $songs "ğ" songs
regsub -all "Ý" $songs "İ" songs
regsub -all "Ð" $songs "Ğ" songs
regsub -all "Þ" $songs "Ş" songs
regsub -all "
" $songs "Ğ" songs
}}
set songson ""
putquick "notice $target :\037 Tarih \037 \037 Çalan Parça "
foreach m $songs {
if {[regexp {[0-9]{10}} $m]} {
set t1 [clock format $m]
set t2 [lindex $t1 1]
putquick "notice $target :\037[lindex $t1 2] [song:tar $t2] [lindex $t1 3] [lindex $t1 4]\037 --> $songson" ; set songson ""
} else { lappend songson $m
}
}
}}
proc song:tar {t2} {
regsub -all "Jan" $t2 "Ocak" t2
regsub -all "Feb" $t2 "Şubat" t2
regsub -all "Mar" $t2 "Mart" t2
regsub -all "Apr" $t2 "Nisan" t2
regsub -all "May" $t2 "Mayıs" t2
regsub -all "Jun" $t2 "Haziran" t2
regsub -all "Jul" $t2 "Temmuz" t2
regsub -all "Aug" $t2 "Ağustos" t2
regsub -all "Sep" $t2 "Eylül" t2
regsub -all "Nov" $t2 "Ekim" t2
regsub -all "Oct" $t2 "Kasım" t2
regsub -all "Dec" $t2 "Aralık" t2
return $t2
}
proc msg_lastsongs { nick uhost hand arg } { global radiochans; sticarichattsongs $nick }
proc pub_lastsongs { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { sticarichattsongs $nick }}
proc scstream { target } {
global streamip streamport streamtext
putlog "shoutcast: streaminfo requested by $target"
putquick "notice $target :$streamtext"
}
proc msg_stream { nick uhost hand arg } { global radiochans; scstream $nick }
proc pub_stream { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstream $nick }}
proc scgreet { nick arg } {
if {$arg == ""} { putquick "notice $nick :4Mesajı eklemeyi unuttunuz."; return 0}
global dj streamip streamport streampass
putlog "shoutcast: $nick greets fly out to: $arg"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
}}
if { $streamstatus == "1" } {
set temp [open "djnick" r]
set djnick [gets $temp]
close $temp
putquick "privmsg $djnick :(GREET) - $nick - $arg"
} else {
putquick "privmsg $nick :Üzgünüz , Radyo şuan kapalı." }
}}
proc msg_greet { nick uhost hand arg } { global radiochans; scgreet $nick $arg }
proc pub_greet { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scgreet $nick $arg }}
proc msg_setdj { nick uhost hand arg } { global radiochans; setdj $nick $arg }
proc pub_setdj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { setdj $nick $arg }}
proc djnickchange { oldnick uhost hand chan newnick } {
set temp [open "djnick" r]
set djnick [gets $temp]
close $temp
if {$oldnick == $djnick} {
putlog "shoutcast: dj nickchange $oldnick -> $newnick"
set temp [open "djnick" w+]
puts $temp $newnick
close $temp
}}
proc dj { target chan } {
global streamip streamport streampass
putlog "shoutcast: $target asked for dj info"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
set stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]
set sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
}}
if {$streamstatus == 1} {
if {[file exists dj]} {
set temp [open "dj" r]
set dj [gets $temp]
close $temp
putquick "notice $target :$dj şuan yayında!"
} else { putquick "privmsg $chan :8,1 »º» 9Dj :11,1 $stitle 8,1 »ºº« " }
} else {
putserv "PRIVMSG #Radyo $target :Üzgünüz.. Biskrem-Fm Müzik Yayınımız Şuan Kapalı."
}
close $sock
}}
proc msg_dj { nick uhost hand arg } { global radiochans; dj $nick $nick"}
proc pub_dj { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { dj $nick $chan }}
proc scstat {target} {
global streamip streamport streampass
putlog "shoutcast: $target asked for serverstats"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
set repl [string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]
set curhigh [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]
set currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
set surl [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]
set maxl [string range $bl [shrink + 14 "<MAXLISTENERS>" 0 $bl] [shrink - 1 "</MAXLISTENERS>" 0 $bl]]
set bitrate [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]
set stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]
set sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
if {$sgenre != ""} {set sgenre " ($sgenre)"}
set avgtime [string range $bl [shrink + 13 "<AVERAGETIME>" 0 $bl] [shrink - 1 "</AVERAGETIME>" 0 $bl]]
set irc [string range $bl [shrink + 5 "<IRC>" 0 $bl] [shrink - 1 "</IRC>" 0 $bl]]
set icq [string range $bl [shrink + 5 "<ICQ>" 0 $bl] [shrink - 1 "</ICQ>" 0 $bl]]
if {$icq == 0} { set icq "N/A" }
set aim [string range $bl [shrink + 5 "<AIM>" 0 $bl] [shrink - 1 "</AIM>" 0 $bl]]
set webhits [string range $bl [shrink + 9 "<WEBHITS>" 0 $bl] [shrink - 1 "</WEBHITS>" 0 $bl]]
set streamhits [string range $bl [shrink + 12 "<STREAMHITS>" 0 $bl] [shrink - 1 "</STREAMHITS>" 0 $bl]]
set version [string range $bl [shrink + 9 "<VERSION>" 0 $bl] [shrink - 1 "</VERSION>" 0 $bl]]
set openup [string range $bl [shrink + 8 "<PLAYED>" 0 $bl] [shrink - 1 "</PLAYED>" 0 $bl]]
set playup [string range $bl [shrink + 9 "<UPDINFO>" 0 $bl] [shrink - 1 "</UPDINFO>" 0 $bl]]
set playon [string range $bl [shrink + 11 "<SONGTITLE>" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]
if {$streamstatus == 1} {
if {[file exists dj]} {
set temp [open "dj" r]
set dj [gets $temp]
close $temp
} else { set dj "none" }
putserv "PRIVMSG #Radyo 8,1 »º» 9Dj :11,1 $stitle 8,1 »ºº« "
putserv "PRIVMSG #Radyo 8,1 »º» 9Çalan Parça : $playon 8»ºº« "
putserv "PRIVMSG #Radyo 8,1»º» 0Şu An 13Biskrem-Fm 0Müzik Yayınımız'ı Dinleyen Kişi Sayısı 8 $repl kişi "
} else {
putserv "PRIVMSG #Radyo 8,1 »º» 9Biskrem-Fm Müzik Yayınımız Şuan Kapalı »ºº« " }
}}
close $sock
}}
proc msg_scstat { nick uhost hand arg } { global radiochans; scstat $nick}
proc pub_scstat { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { scstat $nick }}
proc playing {target} {
global streamip streamport streampass
putlog "shoutcast: $target asked for current song"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]
set songtitle [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]
set stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]
set sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
set songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]
if {$songurl != ""} { set songurl " ($songurl:5135/listen.pls)"}
regsub -all "<" $songtitle "<" songtitle
regsub -all ">" $songtitle ">" songtitle
regsub -all "&" $songtitle "+" songtitle
regsub -all """ $songtitle "\"" songtitle
regsub -all "'" $songtitle "'" songtitle
regsub -all "ÿ" $songtitle "" songtitle
regsub -all "ý" $songtitle "ı" songtitle
regsub -all "Ö" $songtitle "Ö" songtitle
regsub -all "Ü" $songtitle "Ü" songtitle
regsub -all "ö" $songtitle "Ö" songtitle
regsub -all "ç" $songtitle "ç" songtitle
regsub -all "ü" $songtitle "Ü" songtitle
regsub -all "ð" $songtitle "ğ" songtitle
regsub -all "Ý" $songtitle "İ" songs
regsub -all "Ð" $songtitle "Ğ" songtitle
regsub -all "
" $songtitle "Ğ" songtitle
if {$streamstatus == 1} {
putquick "notice $target :\00308,01»º» \00309Radyo - Çalan Parça :\00313 $songtitle\00309 Dj :\00311 $stitle ($sgenre)\00300 $::tamadres\00308 »ºº« "
} else {
putquick "notice $target :8,1 »º» 9Biskrem-Fm Müzik Yayınımız Şuan Kapalı »ºº« "
}}}
close $sock
}}
proc msg_playing { nick uhost hand arg } { global radiochans; playing $nick}
proc pub_playing { nick uhost hand chan arg } { global radiochans; if {([lsearch -exact [string tolower $radiochans] [string tolower $chan]] != -1) || ($radiochans == "")} { playing $nick }}
proc isonline { nick uhost hand chan arg } {
global radiochans announce tellusers tellsongs tellbitrate urltopic
global offlinetext offlinetopic onlinetext onlinetopic
global streamip streampass streamport
if {$announce == 1 || $tellsongs == 1 || $tellusers == 1 || $tellbitrate == 1} {
set isonlinefile "isonline"
set oldisonline "isonline: 0"
set oldcurlist "curlist: 0"
set oldcurhigh "curhigh: 0"
set oldsong "cursong: 0"
set oldbitrate "bitrate: 0"
if {[file exists $isonlinefile]} {
putlog "shoutcast: checking if stream is online"
set temp [open "isonline" r]
while {[eof $temp] != 1} {
set zeile [gets $temp]
if {[string first "isonline:" $zeile] != -1 } { set oldisonline $zeile }
if {[string first "curlist:" $zeile] != -1 } { set oldcurlist $zeile }
if {[string first "curhigh:" $zeile] != -1 } { set oldcurhigh $zeile }
if {[string first "cursong:" $zeile] != -1 } { set oldsong $zeile }
if {[string first "bitrate:" $zeile] != -1 } { set oldbitrate $zeile }
}
close $temp
}
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0} else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set streamstatus "isonline: [string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]"
set repl "1[string range $bl [shrink + 19 "<REPORTEDLISTENERS>" 0 $bl] [shrink - 1 "</REPORTEDLISTENERS>" 0 $bl]]"
set curhigh "curhigh: [string range $bl [shrink + 15 "<PEAKLISTENERS>" 0 $bl] [shrink - 1 "</PEAKLISTENERS>" 0 $bl]]"
set currentl [string range $bl [shrink + 18 "<CURRENTLISTENERS>" 0 $bl] [shrink - 1 "</CURRENTLISTENERS>" 0 $bl]]
set voicevr [string range $bl [shrink + 11 "<LISTENERS>" 0 $bl] [shrink - 1 "</LISTENERS>" 0 $bl]]
set surl "serverurl: [string range $bl [shrink + 11 "<SERVERURL>" 0 $bl] [shrink - 1 "</SERVERURL>" 0 $bl]]"
set cursong "cursong: [string range $bl [shrink + 11 "<SONGTITLE" 0 $bl] [shrink - 1 "</SONGTITLE>" 0 $bl]]"
set songurl [string range $bl [shrink + 9 "<SONGURL>" 0 $bl] [shrink - 1 "</SONGURL>" 0 $bl]]
set bitrate "bitrate: [string range $bl [shrink + 9 "<BITRATE>" 0 $bl] [shrink - 1 "</BITRATE>" 0 $bl]]"
set stitle [string range $bl [shrink + 13 "<SERVERTITLE>" 0 $bl] [shrink - 1 "</SERVERTITLE>" 0 $bl]]
set sgenre [string range $bl [shrink + 13 "<SERVERGENRE>" 0 $bl] [shrink - 1 "</SERVERGENRE>" 0 $bl]]
}}
close $sock
}
set temp [open "isonline" w+]
puts $temp "$streamstatus\n$repl\n$curhigh\n$cursong\n$bitrate"
close $temp
if {$announce == 1 } {
if {$streamstatus == "isonline: 0" && $oldisonline == "isonline: 1"} {
poststuff privmsg $offlinetext
if {$urltopic == 1} { poststuff topic $offlinetopic }
}
if {$streamstatus == "isonline: 1" && $oldisonline == "isonline: 0" } {
if {$sgenre != ""} {
set sgenre " ($sgenre)"
}
putquick "os global $onlinetext"
poststuff privmsg "8,1 »º» 0,1Biskrem-Fm Müzik Yayını Url Adresimiz: 8,1http://Radyo.Biskrem.Net:1675/listen.pls"
if {$urltopic == 1} { poststuff topic "$onlinetopic" }
}}
if {($tellusers == 1) && ($streamstatus == "isonline: 1") && ($oldcurhigh != "curhigh: 0") } {
if {$oldcurhigh != $curhigh} {
poststuff privmsg "4,15Yeni dinleyici sayısı : 1[lindex $curhigh 1]"
}
if {$oldcurlist != $repl} {
poststuff privmsg "8,1 »º» 0Şu An 13Biskrem-Fm 0Müzik Yayınımız'ı Dinleyen Kişi Sayısı 8 $repl kişi "
}}
if {($tellsongs == 1) && ($oldsong != $cursong) && ($streamstatus == "isonline: 1") } {
if {$songurl != ""} { set songurl " $songurl:9998/listen.pls"}
regsub -all "<" $cursong "<" cursong
regsub -all ">" $cursong ">" cursong
regsub -all "&" $cursong "+" cursong
regsub -all """ $cursong "\"" cursong
regsub -all "'" $cursong "'" cursong
regsub -all "ÿ" $cursong "" cursong
regsub -all "Ö" $cursong "Ö" cursong
regsub -all "Ü" $cursong "Ü" cursong
regsub -all "ç" $cursong "ç" cursong
regsub -all "ö" $cursong "Ö" cursong
regsub -all "ü" $cursong "Ü" cursong
regsub -all "ý" $cursong "ı" cursong
regsub -all "" $cursong "ö" cursong
regsub -all "Ý" $cursong "İ" cursong
regsub -all "Ð" $cursong "Ğ" cursong
regsub -all "
" $cursong "Ğ" cursong
putquick "wallops \00308,01 »º» \00309Radyo - Çalan Parça : \00313[lrange $cursong 1 [llength $cursong]] \00300$::tamadres \00308»ºº«"
set wmsg [rand 4]
if {$wmsg == "1"} { putquick "privmsg \00302Eğer bu bildiriyi almak istemiyorsanız :\00305\002 /mode Nick -w \00302\002yazınız." }
poststuff privmsg "8,1 »º» 9Radyo - Çalan Parça : 13[lrange $cursong 1 [llength $cursong]] 8«ºº« "
poststuff privmsg "8,1 »º» 9Dj :11,1 $sgenre \00300($stitle) 8,1 «ºº« "
poststuff privmsg "\00308,01 »º» \00309Link :\0030 http://Radyo.Biskrem.Net:1675/listen.pls\00308 «ºº«"
poststuff privmsg "\00308,01 »º» \00309URL :\0030
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
poststuff privmsg "8,1 »º» 11,1Bizi Seçtiğiniz için Teşekkür Ederiz.8,1«ºº«"
set temp [open "djnicki" r]
set dtemp [gets $temp]
close $temp
if {$dtemp == ""} {
putquick "os global \00308,1 »º» \00309Şuan Yayın Yapan Dj :\00311,01 $sgenre \00300($stitle) \00308,01 »ºº«"
set temp [open "djnicki" w]
puts $temp $sgenre
close $temp
setdj $sgenre ""
}
if {$dtemp != "" && $dtemp != "$sgenre"} {
putlog "bura 2 $dtemp"
putquick "os global \00308,1 »º» \00309Şuan Yayın Yapan Dj :\00311,01 $sgenre \00300($stitle) \00308,01 «ºº«"
set temp [open "djnicki" w]
puts $temp $sgenre
close $temp
setdj $sgenre ""
}
}
if {($tellbitrate == 1) && ($oldbitrate != $bitrate) && ($streamstatus == "isonline: 1") && ($oldbitrate != "bitrate: 0")} {
poststuff privmsg "$oldbitrate kbps'den [lindex $bitrate 1] kbps'ye değişti."
}}}
bind pub - !istek istek
proc istek {n u h c a} {
global gnick
set gnick $n
set kanal [lindex $a ]
putserv "PRIVMSG #Dj 8,1 »º» 9ISTEK : 11 İsteyen: 4 $gnick 0İsteği: 4 $kanal 11 !var , !yok Şeklinde cevaplayın 0İstek Almıyorsanız 11 !calma 0Şeklinde Cevaplayınız 8,1 «º«"
putserv "PRIVMSG #Radyo 8,1 »º» 9 İsteğiniz iletilmiştir. 11 $gnick 2( $kanal ) 8,1 «º«"
}
bind pub - !var vardir
proc vardir {n u h c a} {
global gnick
set gnick $n
set kanal [lindex $a ]
putserv "PRIVMSG #Radyo 8,1 »º» 9 İsteğiniz Listemde Mevcuttur, Çalmak Üzere Sıraya Alınmıştır : 11 $gnick 8,1 «º«"
putserv "PRIVMSG #Dj 8,1 »º» 9 Cevabın Sıraya Alındı Olarak Yollandi : 11 $gnick 8,1 «º«"
}
bind pub - !yok yoktur
proc yoktur {n u h c a} {
global gnick
set gnick $n
set kanal [lindex $a ]
putserv "PRIVMSG #Radyo 8,1 »º» 9 İsteğiniz Listemde Yoktur Lütfen Başka İstekte Bulunun : 11 $gnick 8,1 «º«"
putserv "PRIVMSG #Dj 8,1 »º» 9 Cevabın Listemde Yok Olarak Yollandi Dj 11 8,1 «º«"
}
bind pub - !calma calma
proc calma {n u h c a} {
global gnick
set gnick $n
set kanal [lindex $a ]
putserv "PRIVMSG #Radyo 8,1 »º» 9Şuan İstek Almıyoruz Lütfen Daha Sonra Tekrar Deneyin : 11 $gnick 8,1 «º«"
putserv "PRIVMSG #Dj 8,1 »º» 9 Cevabın İstek Almıyorum Olarak Yollandi Dj 11 $gnick 2( $kanal ) 8,1 «º«"
}
bind time - "* * * * *" yenidinleyici
proc yenidinleyici {min hour day month year} {
global streamip streampass streamport
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0
} else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set voicevr [string range $bl [shrink + 11 "<LISTENERS>" 0 $bl] [shrink - 1 "</LISTENERS>" 0 $bl]]
set streamstatus "[string range $bl [shrink + 14 "<STREAMSTATUS>" 0 $bl] [shrink - 1 "</STREAMSTATUS>" 0 $bl]]"
}
}
close $sock
}
if {[info exists streamstatus] && $streamstatus == "1"} {
set voicevr [temiz $voicevr]
if {[llength $voicevr] < 1} { return 1 }
set deger 0
set ::rawcount 0
set ipler ""
bind raw -|- 352 voysver
foreach i $voicevr {
if {[regexp {^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} [lindex $voicevr $deger]]} {
incr ::rawcount
lappend ipler "[lindex $voicevr $deger] "
}
incr deger
}
set ydeger 0
foreach j $ipler {
putquick "who +i [lindex $ipler $ydeger]"
incr ydeger
}
}
}
proc voysver {from keyword arg} {
set x [open dinleyici1.txt a]
puts $x [lindex $arg 5]
close $x
}
bind raw - 315 countdusur
proc countdusur {from keyword arg} {
global radiochans
if {$::rawcount > 0} {
set ::rawcount [expr $::rawcount - 1]
if {$::rawcount == "0"} {
unbind raw -|- 352 voysver
if {![file exists dinleyici2.txt]} {
putlog "şuan1 dinleyici2.txt : [file exists dinleyici2.txt]"
set x [open dinleyici1.txt r]
set y [read $x]
close $x
set w [open dinleyici2.txt a]
puts $w $y
close $w
foreach m $y {
if {[onchan $m $radiochans]} {
putquick "mode $radiochans +v $m"
putquick "privmsg $radiochans :\002$m\002 Radyo'yu dinlediğiniz için teşekkürler."
}
}
file delete dinleyici1.txt
} elseif {[file exists dinleyici2.txt]} {
set t [open dinleyici1.txt]
set m [open dinleyici2.txt]
set t1 [read $t]
set m1 [read $m]
foreach x $t1 {
set bulundu 0
foreach y $m1 {
if {$x == $y} { set bulundu 1 }
}
if {$bulundu == "0"} {
putquick "mode $radiochans +v $x"
putquick "privmsg $radiochans :\002$x\002 Biskrem-Fm Müzik Yayınımızı Dinlediğiniz için Teşekkürler."
putquick "notice $x :\002$x\002 #Radyo Biskrem-Fm Müzik Yayınımızı Dinlediğiniz için Teşekkürler"
}
}
foreach x $m1 {
set bulundu 0
foreach y $t1 {
if {$x == $y} { set bulundu 1 }
}
if {$bulundu == "0"} {
putquick "mode $radiochans -v $x"
}
}
close $m ; close $t
file delete dinleyici2.txt
file copy dinleyici1.txt dinleyici2.txt
file delete dinleyici1.txt
}
}
}
}
proc temiz {veri} {
regsub -all \< $veri " " veri
regsub -all \/ $veri " " veri
regsub -all \> $veri " " veri
return $veri
}
bind pub - !pass pass
proc pass {n u h c a} {
global gnick
set gnick $n
set kanal [lindex $a ]
putserv "PRIVMSG #Dj 12Ip Adresi :4 ****** 12Port :4 **** 12Şifre :4 ***** "
putserv "PRIVMSG #Dj 12Bu Bilgileri Kimse ile paylaşmayın "
putserv "PRIVMSG #Dj 12Bu isteğiniz nickiniz ve ip adresinizle kaydedildi şifremizin çalınması durumunda sorumlusunuz "
}