Bot Control Scripting

There are several ways you can control your bot and give others access to your bot. A small understanding of user levels and the remote section would be helpful when writing your bot.




Dcc Chat Controls

By using Dcc chat controls you will be able to control your bot without the worry of lag or splits.

Since mIRC 4.7 now allows user levels to be named instead of numbered, in the following examples anyone with an access level of "master" will have access to these controls.
Remote, Commands:
1:DCC CHAT: {
   close -c $nick
   notice $nick Access Denied. Auto-20 second ignore.
   halt
}
master:DCC CHAT: {
   auser master $nick
}
Note: The access level for ON CHAT has to be by nick so thats what the above example does.

Remote, Events:
master:ON CHATOPEN: {
   msg = $+ $nick Welcome $nick Type .help for a list of controls.
}
master:ON CHATCLOSE: {
   notice $nick DCC Chat connection Closed.
   close -c $nick
   ruser master $nick
}
master:ON CHAT:.help: {
   msg = $+ $nick Controls:
   msg = $+ $nick .join   .part   .deop   .op   .kick
   msg = $+ $nick .ban   .msg   .topic
}
master:ON CHAT:.join*: {
   msg = $+ $nick Joining: $parm2
   join $parm2
}
master:ON CHAT:.part*: {
   msg = $+ $nick Parting: $parm2
   part $parm2
}
master:ON CHAT:.deop*: {
   if ($me isop $parm2) {
     msg = $+ $nick Deoping $parm3 in $parm2
     mode $parm2 -o $parm3
     halt
   }
   msg = $+ $nick Error: I need ops in $parm2 to do that.
}
master:ON CHAT:.op*: {
   if ($me isop $parm2) {
     msg = $+ $nick Oping $parm3 in $parm2
     mode $parm2 +o $parm3
     halt
   }
   msg = $+ $nick Error: I need ops in $parm2 to do that.
}
master:ON CHAT:.kick*: {
   if ($me isop $parm2) {
     msg = $+ $nick Kicking $parm3 from $parm2
     kick $parm2 $parm3 $parm4*
     halt
   }
   msg = $+ $nick Error: I need ops in $parm2 to do that.
}
master:ON CHAT:.ban*: {
   if ($me isop $parm2) {
     msg = $+ $nick Banning $parm3 from $parm2
     ban $parm2 $parm3 3
     kick $parm2 $parm3 Banned on Request
     halt
   }
   msg = $+ $nick Error: I need ops in $parm2 to do that.
}
master:ON CHAT:.msg*: {
   msg = $+ $nick Message sent to $parm2
   msg $parm2 $parm3*
}
master:ON CHAT:.topic*: {
   msg = $+ $nick Changing $parm2 Topic to $parm3*
   topic $parm2 $parm3*
}
To add people to master level you would need to type "/guser master {nick} 3" without the quotes.


Channel Triggers

These are considered annoying by most and are very unreliable should your bot be on a lagged or split server.
Once again anyone with "master" level access will be able to access these commands.
Remote, Events:
master:ON TEXT:!op*:#:/mode $chan +o $parm2
master:ON TEXT:!kick*:#:/kick $chan $parm2 Requested by $nick
master:ON TEXT:!quit:#:/quit Remote Shut Down Initiated.
master:ON TEXT:!say*:#:/msg $chan $parm2*
master:ON TEXT:!help:#: {
 notice $nick Bot Controls
 notice $nick !op {nick}
 notice $nick !kick {nick}
 notice $nick !say {msg}
 notice $nick !quit
}
And to give someone master access "/guser master {nick} 3" without the quotes.


MSG Controls

While these are better than Channel Controls they are still unreliable should your bot be on a lagged server or split from you.
Remote, Events:
master:ON TEXT:op*:?:/mode $parm2 +o $parm3
master:ON TEXT:kick*:?:/kick $parm2 $parm3 Requested by $nick
master:ON TEXT:quit:?:/quit Remote Shut Down Initiated.
master:ON TEXT:say*:?:/msg $parm2 $parm3*
Note: Msgs do not return $chan so you will need to specify it in the msg.


Ctcp Controls

These are very similar to the msg controls only these are triggered with ctcp commands and can be unreliable should your bot be split or lagged from you.
Remote, Events:
master:op:/mode $parm2 +o $parm3
master:kick:?:/kick $parm2 $parm3 Requested by $nick
master:quit:/quit Remote Shut Down Initiated.
master:say:/msg $parm2 $parm3*
Note: Private ctcps do not return $chan so you will need to specify it in the ctcp.
I think the $parms are right but you may need to adjust it a little.




This page hosted by Get your own Free Homepage
©1996 The Scripters Guild All Rights Reserved
Please send all questions and comments to TiAMaT
1