This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

add isop to the soutcast.tcl [SOLVED]

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

add isop to the soutcast.tcl [SOLVED]

Post by Fire-Fox »

how can i add isop to this script
i have tryed but no luck so fare

Code: Select all

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.
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

RE: add isop to the soutcast.tcl

Post by TCL_no_TK »

something like

Code: Select all

foreach target [chanlist #mychannel] {
 if {[isop $target #mychannel]} {
  set <something> "$target is an op
 }
}
i dont think
if {$djnickname == "" } { set $djnickname $nickname }
that should be in there :/ maybe before it would be better.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

First of all:

(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

Try this:

Code: Select all

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.
==================================
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

step 1, read the information in the script

Code: Select all

# shoutcast.tcl v1.03 by domsen <domsen@domsen.org> (c)2oo5
#
# comments? bugs? ideas? requests? money? beer?
# plz mail me or visit my homepage @ www.domsen.org
# visit #newsticker@ircnet
contacting the author first about modifications would have been the proper things to do
User avatar
Fire-Fox
Master
Posts: 289
Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null

Post by Fire-Fox »

DragnLord wrote:step 1, read the information in the script

Code: Select all

# shoutcast.tcl v1.03 by domsen <domsen@domsen.org> (c)2oo5
#
# comments? bugs? ideas? requests? money? beer?
# plz mail me or visit my homepage @ www.domsen.org
# visit #newsticker@ircnet
contacting the author first about modifications would have been the proper things to do
The site soes not work :( so it's hard to do some researche :)
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
User avatar
DragnLord
Owner
Posts: 711
Joined: Sat Jan 24, 2004 4:58 pm
Location: C'ville, Virginia, USA

Post by DragnLord »

and you went to ircnet also?
the website is not the only way....
# visit #newsticker@ircnet
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Contact the author then: domsen@domsen.org
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Post Reply