Well, I always look at hawkee's snippets and I see some bot scripts that could use some work. So what I wanted to do is make a bot the way some people do and make it so it's enjoyable and useable everywhere :).
It has different levels such as:
Owner - Admin - Helper
I chose these 3 because I felt they best described the purpose.
This is mainly a channel bot, and if you'd like to comment on it, of course, post below. Thanks :D
This was originally made for SwiftIRC.
Update v1.1 - Added a variable script
Update v2.2 - Added more commands.
alias head { return 14.:(10 $+ $1- $+ 14):. }
alias sub { return 10 $+ $1- $+ }
alias sub1 { return (10 $+ $1- $+ ) }
alias id { ns id PASSHERE }
On $3:TEXT:$(* $+ $me $+ *):*:{
if ($ulevel == 5) {
if $2 == raw || $2 == perform || $2 == do { $eval($3-,2) }
if $2 == say msg $chan $eval($3-,2)
if $2 == join scon -r join $3
if $2 == part scon -r part $3
if $2 == add auser $address($3,3) $4
if $2 == del ruser $address($3,3)
if $2 == msg msg $eval($3-,2) ( $+ $nick $+ )
if $2 == echo notice $nick $eval($3-,2)
if $2 == up || $2 == update ns update $lf notice $nick Status Updated
if $2 == id id
if ($2 == dns) { set -u5 %targ $chan | dns $3- }
if ($left($2,1) == + || $left($2,1) == -) { mode $chan $eval($2-,2) }
if $2 == k || $2 == kick cs kick $chan $3 $iif($4,$4-,Unspecified)
if $2 == kb cs ban $chan $3 $iif($4,$4-,Unspecified)
if $2 == mute mode $chan +b ~q: $+ $address($3,2)
if $2 == unmute mode $chan -b ~q: $+ $address($3,2)
if $2 == cban mode $chan +b ~c: $+ $3
if $2 == uncban || $2 == decban mode $chan -b ~c: $+ $3
if $2 == ucount notice $nick $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == @ucount msg $chan $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == hop cycle $iif($3,$3,$chan)
if $2 == ibl mode $chan -b $ibl(#,$3)
if $2 == reban mode $chan -b+b $ibl(#,$3) $ibl(#,$3)
if $2 == ban ban $chan $3 $iif($4,2,$4)
if ($2 == addv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | notice $nick DONE }
if ($2 == playv) { notice $nick Data for $iif($left($3,1) != %,$+(%,$3),$3) is $($iif($left($3,1) != %,$+(%,$3),$3),3) }
if ($2 == remv) { unset $iif($left($3,1) = %,$3,$+(%,$3)) | notice $nick DONE }
if ($2 == editv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | .notice $nick New data for variable $3 is now $4- $+ . }
}
if ($ulevel == 4) {
if $2 == raw || $2 == perform || $2 == do $eval($3-,2)
if $2 == say msg $chan $eval($3-,2)
if $2 == msg msg $eval($3-,2) ( $+ $nick $+ )
if $2 == echo notice $nick $eval($3-,2)
if $2 == up || $2 == update ns update $lf notice $nick Status Updated
if $2 == id id
if ($2 == dns) { set -u5 %targ $chan | dns $3- }
if ($left($2,1) == + || $left($2,1) == -) { mode $chan $eval($2-,2) }
if $2 == k || $2 == kick cs kick $chan $3 $iif($4,$4-,Unspecified)
if $2 == kb cs ban $chan $3 $iif($4,$4-,Unspecified)
if $2 == mute mode $chan +b ~q: $+ $address($3,2)
if $2 == unmute mode $chan -b ~q: $+ $address($3,2)
if $2 == cban mode $chan +b ~c: $+ $3
if $2 == uncban || $2 == decban mode $chan -b ~c: $+ $3
if $2 == ucount notice $nick $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == @ucount msg $chan $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == hop cycle $iif($3,$3,$chan)
if $2 == join scon -r join $3
if $3 == part scon -r part $3
if $2 == ibl mode $chan -b $ibl(#,$3)
if $2 == reban mode $chan -b+b $ibl(#,$3) $ibl(#,$3)
if $2 == ban ban $chan $3 $iif($4,2,$4)
if ($2 == addv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | notice $nick DONE }
if ($2 == playv) { notice $nick Data for $iif($left($3,1) != %,$+(%,$3),$3) is $($iif($left($3,1) != %,$+(%,$3),$3),3) }
if ($2 == remv) { unset $iif($left($3,1) = %,$3,$+(%,$3)) | notice $nick DONE }
if ($2 == editv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | .notice $nick New data for variable $3 is now $4- $+ . }
}
if ($ulevel == 3) {
if $2 == say msg $chan $eval($3-,2)
if $2 == msg msg $eval($3-,2) ( $+ $nick $+ )
if $2 == echo notice $nick $eval($3-,2)
if $2 == up || $2 == update ns update $lf notice $nick Status Updated
if $2 == id id
if ($2 == dns) { set -u5 %targ $chan | dns $3- }
if ($left($2,1) == + || $left($2,1) == -) { mode $chan $eval($2-,2) }
if $2 == k || $2 == kick cs kick $chan $3 $iif($4,$4-,Unspecified)
if $2 == kb cs ban $chan $3 $iif($4,$4-,Unspecified)
if $2 == mute mode $chan +b ~q: $+ $address($3,2)
if $2 == unmute mode $chan -b ~q: $+ $address($3,2)
if $2 == cban mode $chan +b ~c: $+ $3
if $2 == uncban || $2 == decban mode $chan -b ~c: $+ $3
if $2 == ucount notice $nick $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == @ucount msg $chan $head(uCount) The current ucount of $sub($chan) is: $sub($nick(#,0))
if $2 == hop cycle $iif($3,$3,$chan)
if $2 == ibl mode $chan -b $ibl(#,$3)
if $2 == reban mode $chan -b+b $ibl(#,$3) $ibl(#,$3)
if $2 == ban ban $chan $3 $iif($4,2,$4)
if ($2 == addv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | notice $nick DONE }
if ($2 == playv) { notice $nick Data for $iif($left($3,1) != %,$+(%,$3),$3) is $($iif($left($3,1) != %,$+(%,$3),$3),3) }
if ($2 == remv) { unset $iif($left($3,1) = %,$3,$+(%,$3)) | notice $nick DONE }
if ($2 == editv) { set $iif($left($3,1) = %,$3,$+(%,$3)) $4- | .notice $nick New data for variable $3 is now $4- $+ . }
}
}
On *:Join:#:{
if (!$istok(#mSL #Rshelp #Help #Support #IRChelp,$chan,32)) {
if ($ulevel == 5) msg $chan $head(Owner) $nick
if ($ulevel == 4) msg $chan $head(Admin) $nick
if ($ulevel == 3) msg $chan $head(Helper) $nick
}
}
on 1:dns: {
var %n = $dns(0)
.msg %targ $head(Dns) Found $sub(%n) Address(es) for $dns(%n).addr
while (%n > 0) { .msg %targ $head(Dns) $sub(Address:) $dns(%n).addr $sub(Ip:) $dns(%n).ip | dec %n
}
}
On *:Join:#:{ if ($ialchan($address($nick,3),$chan,0) > 1) { .msg $chan $head(Clone) $nick $sub(-) $ialchan($address($nick,3),$chan,0) $sub(-) Total Clones From $+ $sub(:) $address($nick,3) } }