IRC Bot Topic System

By Elijah on Oct 28, 2009

I'm sure many people have this already but I decided to upload it anyway...

It sets the topic for your channel on an IRC Network... i.e. General Chat | John is here | Today's winner is Dave! | #john on QuakeNet

It comes with a !winner function which chooses one person from the channel randomly... if the channel owner is doing it then it should set the winner in the topic as well... just say !tsync to make the winner in the topic change.

Please switch out YOURNICKHERE with your nick and YOURHOSTNAMEHERE with the part of your hostname after the @.

!topic - Changes the topic (Only Half-Ops and higher may do this) i.e. General Chat
!owner - Changes the name of the owner in the topic (Only a channel owner may do this) i.e. John
!verb - Changes the verb or word in the status (Only a channel owner may do this) i.e. is
!status - Changes the status in the topic (Only a channel owner may do this) i.e. here
!static - Changes the static part of the topic (Must be a SOP (Admin) or higher) i.e. #john on QuakeNet
!divider - Changes the divider that divides the parts of the topic (Must be a SOP (Admin) or higher) i.e. |
!tsync - Syncs the topic
!winner - Chooses one person from the channel randomly and gives the results (If the owner does this s/he can use !tsync to sync the winner to the topic)

If you find a bug, please tell me in a comment, thanks

on *:TEXT:!topic*:#: {
  if ($nick ishop $chan || $nick isop $chan) {
    topic $chan $2- %divider %owner %verb %status %divider Today's winner is %winner $+ ! %divider %static
    set %topic $2-
    halt
    } else {
    notice $nick Permission denied... must have hop (+h) status or higher
  }
}
on *:TEXT:!chanowner*:#: {
  if ($nick == YOURNICKHERE) || ($address($nick,2) == @YOURHOSTNAMEHERE) {
    topic $chan %topic %divider $2 %verb %status %divider Today's winner is %winner $+ ! %divider %static
    set %owner $2
    halt
    } else {
    notice $nick Permission denied... must be a channel owner (+q)
  }
}
on *:TEXT:!verb*:#: {
  if ($nick == YOURNICKHERE) || ($address($nick,2) == @YOURHOSTNAMEHERE) {
    topic $chan %topic %divider %owner $2 %status %divider Today's winner is %winner $+ ! %divider %static
    set %verb $2
    halt
    } else {
    notice $nick Permission denied... must be a channel owner (+q)
  }
}
on *:TEXT:!status*:#: {
  if ($nick == YOURNICKHERE) || ($address($nick,2) == @YOURHOSTNAMEHERE) {
    topic $chan %topic %divider %owner %verb $2- %divider Today's winner is %winner $+ ! %divider %static
    set %status $2-
    halt
    } else {
    notice $nick Permission denied... must be a channel owner (+q)
  }
}
on *:TEXT:!static*:#: {
  if ($nick issop $chan) {
    topic $chan %topic %divider %owner %verb %status %divider Today's winner is %winner $+ ! %divider $2-
    set %static $2-
    halt
    } else {
    notice $nick Permission denied... must be a channel administrator (aka SOP - +ao) or higher
  }
}
on *:TEXT:!divider*:#: {
  if ($nick issop $chan) {
    topic $chan %topic $2 %owner %verb %status $2 Today's winner is %winner $+ ! $2 %static
    set %divider $2
    halt
    } else {
    notice $nick Permission denied... must be a channel administrator (aka SOP - +ao) or higher
  }
}
on *:TEXT:!tsync:#: {
  if ($nick ishop $chan || $nick isop $chan) {
    topic $chan %topic %divider %owner %verb %status %divider Today's winner is %winner $+ ! %divider %static
    halt
    } else {
    notice $nick Permission denied... must have hop (+h) status or higher
  }
}
on *:text:!winner:#: {
  set %nick1 $nick($chan,$rand(1,$nick($chan,0)))
  if (%nick1 == $me) { set %nick1 $nick($chan,$rand(1,$nick($chan,0))) }
  msg $chan The winner is %nick1 $+ ! Congrats %nick1 $+ ! :-)
  if ($nick == YOURNICKHERE) || ($address($nick,2) == @YOURHOSTNAMEHERE) {
    set %winner %nick1
  }
}

Comments

Sign in to comment.
MagicRevealer09   -  Feb 24, 2010

No fair! The divider won't work, help?

 Respond  
FordLawnmower   -  Dec 20, 2009

@Ghost-writer } else { is the proper syntax for many scripting languages.
}
else {
Will cause a compiler error.

 Respond  
RJ12   -  Dec 20, 2009

Aye again man I cant type so just forget it. lol!

 Respond  
RJ12   -  Dec 20, 2009

oops if ($nick isop $chan

But it works!

Edit: I just found the edit button if ($nick isop $chan)

 Respond  
Ghost-writer   -  Dec 20, 2009

lol? if ($nick isop $chan), yours failed as hard as his. And i dont like how you code your if statements lol,

} else {
 Respond  
RJ12   -  Dec 19, 2009

Elijah you messed up Line 39 (ask toop and Samuel we was working on it for a while) it says (if $nick issop $chan) when it should be (if $nick isop $chan) but thank you. I finnaly got it to all work out after lots of time! I will send a memoserv note also

 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.