Timer Advert Script
Platform: mIRC
Published Oct 13, 2010
Updated Oct 13, 2010
This is a small easilly editable script which can rotate user's adverts in the channel and will rename them if they chhange there nick and will also turn off if they leave or disconnect.
The t.set alias allows you to edit the text it says and the theme alias allows you to change the colour of the text.
Commands
!timer on <ADVERT>
!timer off [nick] (Nick is ops only)
Thanks to steel on Torn IRC who helped test :P
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 ($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
}
}
}
}