egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

add isop to the soutcast.tcl [SOLVED]

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Wed Sep 19, 2007 6:35 pm    Post subject: add isop to the soutcast.tcl [SOLVED] Reply with quote

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

Code:
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." }
}

_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze


Last edited by Fire-Fox on Thu Sep 20, 2007 10:35 am; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
TCL_no_TK
Owner


Joined: 25 Aug 2006
Posts: 509
Location: England, Yorkshire

PostPosted: Wed Sep 19, 2007 10:38 pm    Post subject: RE: add isop to the soutcast.tcl Reply with quote

something like
Code:
foreach target [chanlist #mychannel] {
 if {[isop $target #mychannel]} {
  set <something> "$target is an op
 }
}
i dont think
Quote:
if {$djnickname == "" } { set $djnickname $nickname }
that should be in there :/ maybe before it would be better.
_________________
TCL the misunderstood
Back to top
View user's profile Send private message Send e-mail
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Wed Sep 19, 2007 10:58 pm    Post subject: Reply with quote

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:

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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Sep 20, 2007 12:08 am    Post subject: Reply with quote

step 1, read the information in the script
Code:
# 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
Back to top
View user's profile Send private message
Fire-Fox
Master


Joined: 23 Sep 2006
Posts: 270
Location: /dev/null

PostPosted: Thu Sep 20, 2007 6:27 am    Post subject: Reply with quote

DragnLord wrote:
step 1, read the information in the script
Code:
# 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 Sad so it's hard to do some researche Smile
_________________
GreatZ
Fire-Fox | Denmark

Scripts: Relay | Store Text | TvMaze
Back to top
View user's profile Send private message MSN Messenger
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Thu Sep 20, 2007 12:33 pm    Post subject: Reply with quote

and you went to ircnet also?
the website is not the only way....
Quote:
# visit #newsticker@ircnet
Back to top
View user's profile Send private message
awyeah
Revered One


Joined: 26 Apr 2004
Posts: 1580
Location: Switzerland

PostPosted: Thu Sep 20, 2007 1:03 pm    Post subject: Reply with quote

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.
==================================
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber