| View previous topic :: View next topic |
| Author |
Message |
ricktee76 Voice
Joined: 12 Jul 2016 Posts: 11
|
Posted: Tue Nov 15, 2016 3:43 pm Post subject: replace bind time with utimer? |
|
|
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:
| Code: | | bind time - "* * * * *" isonline |
which checks every minute.
| Code: | 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 [list isonline]
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 |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Wed Nov 16, 2016 2:16 am Post subject: |
|
|
The "arguments" in a bind time are <minute> <hour> <day> <month> <year> not 'nick uhost hand chan arg'.
Anyway, give this a try:
| Code: |
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: |
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. |
|
| Back to top |
|
 |
ricktee76 Voice
Joined: 12 Jul 2016 Posts: 11
|
Posted: Wed Nov 16, 2016 6:13 pm Post subject: |
|
|
thanks again caesar your reply was helpful once again, i have now got it working as i wanted by adding.
Much appreciated. | Code: | if {[info exists isonline]} {
utimer xx [list isonline $nick $uhost $hand $chan $arg]
}
} |
|
|
| Back to top |
|
 |
|