Advert script

Advert script

mIRC Snippet that lets you to add different messages to advert on irc channels. You can use channel command to turn on or off the script.

Postat de Copyright Categorie Review user Vizualizari Data
BLKoldSUN [M]ike activity Cod testat 354 2024-04-28 15:02:10

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,] %id $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 
      }
    }
  }