Channel Advert Timers

By SharkEyes on Jun 24, 2009

UPDATE: 7th January 2011
Description changes and spelling mistakes.

UPDATE: 9th January 2011
All timers are halted at midnight everyday.

This script allows users to place adverts/messages to repeat themselves every 15 minutes in a channel. The script also allows the user to place differnt adverts/messages in two or more differnt channels even with the same bot.

The advert will also turn off if the user leaves the chbannel or quits from the server.

Commands
!timer end - To cancel a nicks timer, Channel staff only
!timer off - Cancel your own timer
!timer on - Make a timer
!timer - Check the status of the timer

Just post it straight into your/bots remotes :)

on *:TEXT:!timer end*:#:{
  if ($nick isop $chan) || ($nick ishop $chan) || ($nick isowner $chan) || (& isin $nick($2,$1).pnick) {
    if ($3) {
      if ($timer $+ $3 $+ _ $+ $chan) {
        msg $chan Sorry $3 your timer has been canceled by $nick
        timer $+ $3 $+ _ $+ $chan off
      }
      else { msg $chan Sorry $nick $+ , $nick does not have an active timer in place on $chan | halt }
    }
    else { msg $chan You didn't enter a nick, Please use !timer end <nick>. | halt }
  }
  else { msg $chan Sorry, Only channel staff can end a timer for someone else. }
}
on *:TEXT:!timer on*:#:{
  if (!$timer $+ $nick $+ _ $+ $chan) {
    if (!$23) {
        msg $chan Your timer has been activated.
        set %message_ $+ $nick $3-22
        timer $+ $nick $+ _ $+ $chan $+ first 1 2 msg $chan New! $chr(91) $+ $nick $+ $chr(93) $chr(91) $+ $read(Ids.txt, s, $nick) $+ $chr(93) $+ : %message_ $+ $nick
        timer $+ $nick $+ _ $+ $chan 0 900 msg $chan $chr(91) $+ $nick $+ $chr(93) $chr(91) $+ $read(Ids.txt, s, $nick) $+ $chr(93) $+ : %message_ $+ $nick
        timerturnalloff 00:00 1 1 timers off
        timerturnallodd2 00:00 1 1 msg $chan All timers have been halted
      }
      else { msg $chan Sorry $nick $+ , Your timer can only contain a maximum of 20 words. | halt }
    }
    else { msg $chan You already have an active timer for this channel, Please use !timer off to end your current timer. }
}
on *:TEXT:!timer off:#:{
  if ($timer $+ $nick $+ _ $+ $chan) {
    msg $chan $nick Your timer has been de-activated.
    timer $+ $nick $+ _ $+ $chan off
    unset %message_ $+ $nick
    else { msg $chan You do not have an active timer to be de-activated. }
  }
}
on *:TEXT:!timer:#:{
  if ($timer $+ $nick $+ _ $+ $chan) {
    notice $nick Your timer is Online: %message_ $+ $nick
  } 
  else { notice $nick Your timer is Offline, Please use !timer on <message>. }
}
on *:PART:*:#:{
  if ($timer $+ $nick $+ _ $+ $chan) {
    timer $+ $nick $+ _ $+ $chan off
    msg $chan $nick $+ 's timer has been de-activated due to part from the channel.
  }
}
on *:QUIT:*:#:{
  if ($timer $+ $nick $+ _ $+ $chan) {
    timer $+ $nick $+ _ $+ $chan off
    msg $chan $nick $+ 's timer has been de-activated due to quit from the server.
  }
}

Comments

Sign in to comment.
SharkEyes   -  Jan 07, 2011

Thanks for the feedback people. I made this becuase I played a game called Torn City, now called Torn. The game had its own IRC Server and the admins had there own channels with timer scripts. No admin would give me the script so I made my own. Ended up selling this script to other players of the game for loads.

@jeroen I have never had those errors so I wouldn't know how to fix it.

@Testor that just takes out some gaps, completly pointless

 Respond  
Testor   -  Aug 16, 2009

Idk, looks a bit nicer imo :\

 Respond  
Jethro   -  Aug 16, 2009

@Testor, what difference does it make compared to the original?

 Respond  
Testor   -  Aug 16, 2009

I'm sure you could change a lot of the If's from:

 if ($timer $+ $3 $+ _ $+ $chan) { 

to

 if ($+($Timer,$3,_,$chan)) { 
 Respond  
jeroen   -  Aug 16, 2009

When trying the code I'm getting spammed by these errors, even after !timer off

[16:45:36 | 16-08-09]@LayerS: !timer on Visit us
[16:45:45 | 16-08-09] (°) error: unknown command [ #:{ ]
[16:47:10 | 16-08-09] (°) error: unknown command [ *:#: ]
[16:47:21 | 16-08-09] (°) error: unknown command [ #:{ ]
[16:47:26 | 16-08-09] (°) error: unknown command [ #:{ ]
[16:48:01 | 16-08-09] -LayerS- LAGCHK 8881.902
[16:48:16 | 16-08-09] -LayerS- LAGCHK 8897.112
[16:48:32 | 16-08-09] -LayerS- LAGCHK 8912.322
[16:48:47 | 16-08-09] -LayerS- LAGCHK 8927.533
[16:49:02 | 16-08-09] -LayerS- LAGCHK 8942.743
[16:49:17 | 16-08-09] -LayerS- LAGCHK 8957.953

even continues after restarting mIRC

could it be variables of your script conflicting with some NNscript variables? seeing my lag bar doesnt work either anymore.

 Respond  
PATX   -  Jun 24, 2009

Love it. 10/10 :)

 Respond  
Aucun50   -  Jun 24, 2009

"Channle Timers" Did you mean "Channel Timers"

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.