Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.98 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. bind pub o !timer timer
  2. proc timer {nick uhost hand chan text} {
  3.         set type [join [lindex [split $text] 0]]
  4.         set ttime [join [lindex [split $text] 1]]
  5.         set command [join [lindex [split $text] 2]]
  6.         set chantext [join [lrange [split $text] 3 end]]
  7.  
  8.         switch $type {
  9.                 "min" {
  10.                         if {$ttime == ""} {
  11.                                 putquick "PRIVMSG $chan :!ttimer $type <time> <chanmsg \"text\"|command>"
  12.                                 return 0
  13.                         }
  14.                         if {$command == ""} {
  15.                                 putquick "PRIVMSG $chan :!timer $type $ttime <chanmsg \"text\"|command>"
  16.                                 return 0
  17.                         }
  18.                         if {$command == "chanmsg"} {
  19.                                 timer $ttime [list putquick "PRIVMSG $chan :$chantext"]]
  20.                         } else {
  21.                                 timer $ttime [list $command]
  22.                         }
  23.                 }
  24.                 "sec" {
  25.                         if {$ttime == ""} {
  26.                                 putquick "PRIVMSG $chan :!timer $type <time> <chanmsg \"text\"|command>"
  27.                                 return 0
  28.                         }
  29.                         if {$command == ""} {
  30.                                 putquick "PRIVMSG $chan :!timer $type $ttime <chanmsg \"text\"|command>"
  31.                                 return 0
  32.                         }
  33.                         if {$command == "chanmsg"} {
  34.                                 utimer $ttime [list putquick "PRIVMSG $chan :$chantext"]
  35.                         } else {
  36.                                 utimer $ttime [list $command]
  37.  
  38.                         }
  39.                 }
  40.                 default {
  41.                         putquick "PRIVMSG $chan :!timer <min|sec> <time> <chanmsg \"text\"|command>"
  42.                 }
  43.         }
  44. }
  45.  
  46. putlog "\0036timer.tcl\003 \0034loaded\003"