
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 1.98 KB | hits: 15 | expires: Never
bind pub o !timer timer
proc timer {nick uhost hand chan text} {
set type [join [lindex [split $text] 0]]
set ttime [join [lindex [split $text] 1]]
set command [join [lindex [split $text] 2]]
set chantext [join [lrange [split $text] 3 end]]
switch $type {
"min" {
if {$ttime == ""} {
putquick "PRIVMSG $chan :!ttimer $type <time> <chanmsg \"text\"|command>"
return 0
}
if {$command == ""} {
putquick "PRIVMSG $chan :!timer $type $ttime <chanmsg \"text\"|command>"
return 0
}
if {$command == "chanmsg"} {
timer $ttime [list putquick "PRIVMSG $chan :$chantext"]]
} else {
timer $ttime [list $command]
}
}
"sec" {
if {$ttime == ""} {
putquick "PRIVMSG $chan :!timer $type <time> <chanmsg \"text\"|command>"
return 0
}
if {$command == ""} {
putquick "PRIVMSG $chan :!timer $type $ttime <chanmsg \"text\"|command>"
return 0
}
if {$command == "chanmsg"} {
utimer $ttime [list putquick "PRIVMSG $chan :$chantext"]
} else {
utimer $ttime [list $command]
}
}
default {
putquick "PRIVMSG $chan :!timer <min|sec> <time> <chanmsg \"text\"|command>"
}
}
}
putlog "\0036timer.tcl\003 \0034loaded\003"