proc setdj {nickname djnickname } {
global streamip streamport streampass dj ctodjc
foreach nicks [split [chanlist #aliasfm]] {
if {[isop $nicks]} {
if {$djnickname == "" } { set $djnickname $nickname }
}}
putlog "shoutcast: new dj: $djnickname ($nickname)"
set temp [open "dj" w+]
puts $temp $djnickname
close $temp
set temp [open "djnick" w+]
puts $temp $djnickname
close $temp
if { [status] == "1" } { poststuff privmsg " 12\[4AliasFM12\] $nickname Er nu på som Dj: $djnickname 12\[4AliasFM12\]"
if { $ctodjc == "1" } {
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
}
} else {
putserv "privmsg $nickname :9this has not been announced because the radio is currentlfy offline." }
}
Last edited by Fire-Fox on Thu Sep 20, 2007 10:35 am, edited 1 time in total.
(1) Please indent your code properly, because it is difficult to read.
(2) You don't need to split chanlist, since it is already a list.
(3) Use a foreach loop and check the isop condition for that nick on the channel, as mentioned by TCL_no_TK
proc setdj {nickname djnickname} {
global streamip streamport streampass dj ctodjc
foreach nicks [chanlist #aliasfm] {
if {[isop $nicks #aliasfm] {
putlog "shoutcast: new dj: $djnickname ($nickname)"
set temp [open "dj" w+]
puts $temp $djnickname
close $temp
set temp [open "djnick" w+]
puts $temp $djnickname
close $temp
if {[status] == "1"} { poststuff privmsg " 12\[4AliasFM12\] $nickname Er nu på som Dj: $djnickname 12\[4AliasFM12\]"
if {$ctodjc == "1"} {
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
}
} else {
putserv "privmsg $nickname :This has not been announced because the radio is currentlfy offline."
}
}
}
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================