alias theme return 3
alias t.set {
;; 4 is time in seconds
if ($1 == 1) return $+($theme,Your timer will now be run every4 15 minutes ,$theme,infinate times until you disconnect or leave.)
elseif ($1 == 2) return $+($theme,,$nick,,$chr(44) you already have a timer running. Type !timer off to remove your timer.)
elseif ($1 == 3) return $+($theme,[Advert][,$2,] $3-)
elseif ($1 == 4) return 900
elseif ($1 == 5) return $+($theme,Your timer has been removed from the rotation.)
elseif ($1 == 6) return $+($theme,$2 $+ 's timer has been removed from the rotation.)
}
on *:NICK:{
if ($timer($+(.,$nick.,$chan,.advert)).secs) {
timer $+ $+(.,$nick,.,$chan,.advert) off
var %com $left($gettok($timer($+(.,$nick.,$chan,.advert)).com,3-,44),$calc($len($gettok($timer($+(.,$nick.,$chan,.advert)).com,3-,44)) - 1))
.timer $+ $+(.,$newnick,.,$chan,.advert) 0 $v1 msg $chan $+($,t.set,$chr(40),3,$chr(44),$newnick,$chr(44),%com,$chr(41))
}
}
on *:PART:#:{
if ($timer($+(.,$nick.,$chan,.advert)).secs) {
.timer $+ $+(.,$nick,.,$chan,.advert) off
}
}
on *:QUIT:{
if ($timer($+(.,$nick.,$chan,.advert)).secs) {
.timer $+ $+(.,$nick,.,$chan,.advert) off
}
}
on *:TEXT:*:#:{
if ($nick == $mid(#,2) || $nick isop #) {
if ($1 == !timer) {
if ($2 == on) {
if (!$timer($+(.,$nick.,$chan,.advert)).secs) {
notice $nick $t.set(1)
msg $chan $t.set(3,$nick,$3-)
.timer $+ $+(.,$nick,.,$chan,.advert) 0 $t.set(4) msg $chan $+($,t.set,$chr(40),3,$chr(44),$nick,$chr(44),$3-,$chr(41))
}
else {
msg $chan $t.set(2)
}
}
elseif ($2 == off) {
if (!$3) {
msg $chan $t.set(5)
.timer $+ $+(.,$nick,.,$chan,.advert) off
}
elseif ($3 && $nick($chan,$nick,@&~)) {
msg $chan $t.set(6,$3)
.timer $+ $+(.,$3,.,$chan,.advert) off
}
}
}
}
}