Bot v1.2

By chadbdurham on Jan 20, 2009

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) } } 

Comments

Sign in to comment.
raymond   -  Jun 19, 2009

what exactly are the commands here?

 Respond  
chadbdurham   -  Mar 27, 2009

Got to add those commands, forgot to put them in there.

 Respond  
chadbdurham   -  Mar 27, 2009

Botname, join chan

 Respond  
xplo   -  Mar 02, 2009

why using nickserv ?

not every network uses nickserv.

it would be great to use all mirc internal stuff in your script.

ns / cs / bs are all anope services, and undernet does not uses anope :/

 Respond  
Blitzjager   -  Mar 02, 2009

Botname do /join #channel
That should work

 Respond  
benfenn   -  Mar 02, 2009

i don't quite understand how to make it join chans, sorry, i'm new to scripting

 Respond  
chadbdurham   -  Jan 21, 2009

:)

 Respond  
Bluepower10   -  Jan 21, 2009

Ohh, ok. I'll try that then.

 Respond  
chadbdurham   -  Jan 21, 2009

Add yourself to the userlist with guser or auser. /auser 5 $address(you,3)
That makes you owner.
For other levels, there is admin and helper, that's 4 for admin and 3 for helper.

 Respond  
Bluepower10   -  Jan 21, 2009

How do you use it? I installed it, but now what?

 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.