bind time - "00 * * * *" timed_modesFreez wrote: I would like to excute soms tcl commands at one specified time.
Time = 18:00 > set mode $chan +mi
Time = 00:00 > set mode $chan -mi
Code: Select all
bind time - "* * * * *" timed_modes
proc timed_modes {min hour day month year} {
if {$hour == 18 && $min == 20} { pushmode $tgchan -mi }
if {$hour == 00} { pushmode $tgchan +mi }
}
Code: Select all
set tgchan "#triviant"
bind time - "* * * * *" timed_modes
proc timed_modes {min hour day month year} {
if {$hour == 18 && $min == 30} { pushmode $tgchan -mi }
if {$hour == 00} { pushmode $tgchan +mi }
}
Code: Select all
set tgchan "#triviant"
bind time - "* * * * *" timed_modes
proc timed_modes {min hour day month year} {
global tgchan
if {$hour == 18 && $min == 30} { pushmode $tgchan -mi }
if {$hour == 00} { pushmode $tgchan +mi }
}
Code: Select all
proc tgstop {nick host hand chan text} {
global tghinttimer tgnextqtimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin
global tgerrremindtimer tgrebindhinttimer
if {[strlwr $tgchan]==[strlwr $chan]} {
if {$tgplaying==1} {
tggamemsg "[tgcolstop]Triviant is gestopt door $nick!"
if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend }
set tgstreak 0
set tgplaying 0
catch {unbind pubm -|- "$tgchan *" tgcheckanswer}
if {[utimerexists tghint]!=""} {killutimer $tghinttimer}
if {[utimerexists tgnextq]!=""} {killutimer $tgnextqtimer}
if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer}
if {[utimerexists tgrebindhinttimer]!=""} {killtimer $tgrebindhinttimer}
}
}
}
Code: Select all
bind pub -|- !stop tgstop
To callup another procedure from an existing/running procedure use:Freez wrote:It works! I would to like to know how i callup an procedure.
But how?
This is the proc i want to callup. Do you know how? Thank you!Code: Select all
proc tgstop {nick host hand chan text} { global tghinttimer tgnextqtimer tgplaying tgchan tgcurrentanswer tgstreak tgstreakmin global tgerrremindtimer tgrebindhinttimer if {[strlwr $tgchan]==[strlwr $chan]} { if {$tgplaying==1} { tggamemsg "[tgcolstop]Triviant is gestopt door $nick!" if {$tgstreakmin>0&&[lindex [split $tgstreak ,] 1]>=$tgstreakmin} { tgstreakend } set tgstreak 0 set tgplaying 0 catch {unbind pubm -|- "$tgchan *" tgcheckanswer} if {[utimerexists tghint]!=""} {killutimer $tghinttimer} if {[utimerexists tgnextq]!=""} {killutimer $tgnextqtimer} if {[timerexists tgerrremind]!=""} {killtimer $tgerrremindtimer} if {[utimerexists tgrebindhinttimer]!=""} {killtimer $tgrebindhinttimer} } } }
[/code]
Hope this helps!procedure:name arg1 arg2 arg3....argN
#You will need to set the same number of arguments as in your call procedure when you are calling.
#If you want to use a bit of delay to call, you can use timers with 'list'
utimer $myutimer [list procedure:name arg1 arg2 arg3....argN]
To call your procedure use:
tgstop $nick $host $hand $chan $text
But remember nick, host, hand, chan and text all have to be defined.
Code: Select all
if ($day == Sunday) then proc
Code: Select all
if {[clock format [clock seconds] -format %u]==7} {it's sunday}