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.
Help for those learning Tcl or writing their own scripts.
ricktee76
Voice
Posts: 12 Joined: Tue Jul 12, 2016 2:26 am
Post
by ricktee76 » Tue Nov 15, 2016 3:43 pm
I've been running a highly modified domsen Shoutcast script but one thing i cant figure out is the bind time, currently it checks the stream is online every minute and updates the title etc into the chat.
the current bind time:
which checks every minute.
Code: Select all
proc isonline { nick uhost hand chan arg } {
global etc etc etc
global more more more
// isonline code here
}
i have tried
set newtimer [utimer 20 {isonline nick uhost hand chan arg}]
utimer 20
utimer 20 {isonline nick uhost hand chan arg}
the isonline process needs to be run every 20 seconds.
Do i need to add the globals to the utimer?
All help appreciated
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Wed Nov 16, 2016 2:16 am
The "arguments" in a bind time are <minute> <hour> <day> <month> <year> not 'nick uhost hand chan arg'.
Anyway, give this a try:
Code: Select all
proc checkOnline args {
# execute the proc you want
isonline 1 2 3 4 5
# self maintain
utimer 20 [list checkOnline]
}
# start the 20 seconds "infinite" loop
utimer 20 [list checkOnline]
And to adapt this to your code:
Code: Select all
proc isonline { nick uhost hand chan arg } {
global etc etc etc
global more more more
// isonline code here
# self maintain
utimer 20 [list isonline 1 2 3 4 5]
}
# initiate the loop
utimer 20 [list isonline 1 2 3 4 5]
Once the game is over, the king and the pawn go back in the same box.
ricktee76
Voice
Posts: 12 Joined: Tue Jul 12, 2016 2:26 am
Post
by ricktee76 » Wed Nov 16, 2016 6:13 pm
thanks again caesar your reply was helpful once again, i have now got it working as i wanted by adding.
Much appreciated.
Code: Select all
if {[info exists isonline]} {
utimer xx [list isonline $nick $uhost $hand $chan $arg]
}
}