on *:TEXT:.*:#:{
var %say = $right($1,-1)
if ($2 ison $bot.chan) whois $2
if ($ulevel >= 500) {
if (%say == resync) {
cs $bot.chan resync
.timer 1 2 resync $bot.chan
.timer 1 3 notice $nick Resynced all users with mine & ChanServ's list.
}
if (%say == addpeon) {
if (!$2) { notice $nick Please provide a nick. | halt }
if ($2 !ison $bot.chan) { notice $1 I cannot find $2 on $bot.chan | halt }
if ($level($address($2,2)) > 1) { notice $nick $2 already has access on $bot.chan | halt }
.auser 100 $address($2,2)
.notice $1 Added $2 as a peon.
.mode $bot.chan +v $2
}
if (%say == addop) {
if (!$2) { notice $nick Please provide a nick. | halt }
if ($2 !ison $bot.chan) { notice $1 I cannot find $2 on $bot.chan | halt }
if ($level($address($2,2)) > 1) { notice $nick $2 already has access on $bot.chan | halt }
.auser 200 $address($2,2)
.notice $1 Added $2 as an OP.
.mode $bot.chan +o $2
}
if (%say == addmaster) {
if (!$2) { notice $nick Please provide a nick. | halt }
if ($2 !ison $bot.chan) { notice $1 I cannot find $2 on $bot.chan | halt }
if ($level($address($2,2)) > 1) { notice $nick $2 already has access on $bot.chan | halt }
.auser 500 $address($2,2)
.notice $1 Added $2 as a master.
.mode $bot.chan +o $2
}
if (%say == deluser) {
if (!$2) { notice $nick Please provide a nick. | halt }
if ($2 !ison $bot.chan) { notice $1 I cannot find $2 on $bot.chan | halt }
if ($level($address($2,2)) == 1) { notice $nick $2 has no access on $bot.chan | halt }
.ruser $address($2,2)
.notice $1 Removed $2 from the userlist.
.mode $bot.chan -ov $2 $2
}
if (%say == join) {
if ($2 == #support || $2 == #help || $2 == #gamesurge) {
notice $nick Nice try. I'm not joining any of those channels dumbass.
halt
}
if (!$2) {
notice $nick Please provide a channel to join.
halt
}
if ($me ison $2) {
notice $nick I'm already on that channel!
halt
}
else {
set -u2 %_nick $nick
set -u2 %_chan $2
join $2
.timerjoined 1 1 notice There was an error joining %_chan $+ .
}
}
if (%say == part) {
if ($2 == $bot.chan) {
notice $nick Nice try. I'm not leaving my own channel dumbass. | halt
}
if (!$2) {
notice $nick Please provide a channel. | halt
}
if ($me !ison $2) {
notice $nick I'm not on that channel! | halt
}
else {
set -u2 %_nick $nick
set -u2 %_chan $2
part $2
}
}
if (%say == nick) {
if (!$2) { notice $nick Please provide a nick for me to change to. | halt }
set -u2 %_nick $nick
nick $2
notice $nick My nick is now $2
}
if (%say == set) {
if ($regex($2,greeting[1-9]\d*)) {
if (!$3) {
notice $nick $2 $+ : % [ $+ [ $2 ] ]
}
else {
set % [ $+ [ $2 ] ] $3-
notice $nick $2 $+ : % [ $+ [ $2 ] ]
}
}
if ($regex($2,timer[1-9]\d*)) {
if (!$3) {
notice $nick $2 $+ : $gettok($timer($2).com,3-,32)
}
else {
.timer [ $+ [ $2 ] ] 0 $iif($3 isnum,$3,$duration($3)) msg $bot.chan $4-
notice $nick $2 $+ : $gettok($timer($2).com,3-,32)
}
}
}
if (%say == del) {
if ($regex($2,greeting[1-9]\d*)) {
if (!% [ $+ [ $2 ] ]) {
notice $nick I cannot find $2
}
else {
if (!% [ $+ [ $2 ] ]) { notice $nick There is no $2 $+ ! | halt }
notice $nick Removed $2
unset % [ $+ [ $2 ] ]
}
}
if ($2 == greetings) {
notice $nick Removed all greetings.
unset %greeting*
}
if ($2 == timers) {
notice $nick Removed all greetings.
.timertimer* off
}
if ($regex($2,timer[1-9]\d*)) {
if (!$timer($2)) {
notice $nick I cannot find that timer!
}
else {
.timer [ $+ [ $2 ] ] off
notice $nick Timer $2 is now off.
}
}
}
if (%say == greetings) {
if (!%greeting1) { notice $nick Currently, there are no greetings. | halt }
var %x = 1
while (%greeting [ $+ [ %x ] ]) {
notice $nick Greeting $+ %x $+ : $v1
inc %x
}
}
if (%say == timers) {
if (!$timer(timer1)) { notice $nick Currently, there are no timers. | halt }
var %x = 1
while ($timer(timer $+ %x)) {
notice $nick Timer $+ %x ( $+ $duration($timer(timer $+ %x).delay) delay on $gettok($timer(timer $+ %x).com,2,32)) : $gettok($timer(timer $+ %x).com,3-,32)
inc %x
}
}
if (%say == triggers) {
notice $nick Since you are a master, you have access to these commands:
notice $nick .addpeon, .addmaster, .addop, .deluser, .resync, .join, .part, .triggers
notice $nick .set greeting, .del greeting(s), .greetings, .set timer, .del timer(s), .timers
}
}
}
alias resync {
var %x = 1,%voice,%op,%devop
while ($nick($1,%x)) {
var %level = $level($address($v1,2))
if ($v1 == ChanServ) { inc %x | continue }
if ($v1 == $me) { inc %x | continue }
if (%level >= 200) {
%op = %op $nick($1,%x)
}
if (%level >= 100 && %level < 200) {
%voice = %voice $nick($1,%x)
}
inc %x
}
var %x = 1,%y = 6
while ($gettok(%voice,%x - %y,32)) {
var %y = $calc(%x + 5)
mode $1 -oooooo $gettok(%voice,%x - %y,32)
mode $1 +vvvvvv $gettok(%voice,%x - %y,32)
inc %x 6
}
var %x = 1,%y = 6
while ($gettok(%op,%x - %y,32)) {
var %y = $calc(%x + 5)
mode $1 +oooooo $gettok(%op,%x - %y,32)
inc %x 6
}
}
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
; Change #testbot to whatever channel your going to use it for :)
alias bot.chan {
return #testbot
}
on !*:JOIN:$bot.chan:{
if ($ulevel >= 200) { mode $bot.chan +o $nick | goto greeting }
if ($ulevel >= 100) { mode $bot.chan +v $nick | goto greeting }
:greeting
var %x = 1
while (%greeting [ $+ [ %x ] ]) {
notice $nick $v1
inc %x
}
}
on *:JOIN:#:{
if ($nick == $me) {
.timerjoined off
notice %_nick I just joined $chan $+ !
}
}
on *:PART:#:{
notice %_nick I just left %_chan
}
raw 433:*:{
notice %_nick That nickname is already in use.
.timernick off
}
raw 403:*:{
notice %_nick That is an invalid channel.
.timerjoined off
}
raw 405:*:{
notice %_nick I cannot join anymore channels :/
.timerjoined off
}