mIRC Homepage
Posted By: shy_and_quiet help with op script - 08/12/03 03:46 AM
I am trying to get my bot to be able to op me on command, but I'm not sure how to insert it into the bots remote scripts. The thing I tried didn't work. Could someone please give me a hand with the coding?

Thanks, shy

Here is what I tried to use, but it didn't work:

on 1:TEXT:op shy guardian:#Free_Women: { msg $chan /mode # +o shy_and_quiet }

Posted By: KingTomato Re: help with op script - 08/12/03 04:33 AM
change the "msg $chan /mode" to just "/mode $chan". You want to execute the command, not send it to the channel. Also, you may want to look into user modes. I would add yourself to the bot's userlist with a simple command like:

/auser 10 $address(shy_and_quiet, 11)

Then change the command to:

on 10:TEXT:op shy guardian:#Free_Women: {
; i'd normall use the @ prefix, but instead we can give a notice
if ($me isop $chan) /mode $chan +o shy_and_quiet
else /msg $chan Sorry, i do not have operator status
}

The on 10:... means that a user will level 10 (Set using the /auser command) has access to the command. this way a stragler can't just come in and use the command. Though I suppose only one user would benefit from the command, but if someone were to join with your name (and it wasn't you) they could easily op themself otherwise. As for using $address(shy_and_quiet, 11), that mixes your mask in with the name so that if they have your name, with your internet provider, we can almost bet it is you. grin
Posted By: shy_and_quiet Re: help with op script - 08/12/03 04:55 AM
Thank you so much!!

I've never used the userlist before, but I think I have it all figured out, except for what the 11 means?

here is the remote script I'm using now...I have tested it and it works.

on 1:TEXT:op me guardian:#Free_Women:{
if ($nick == bethany) {
./mode # +o Bethany
}
elseif ($nick == shy_and_quiet) {
./mode # +o shy_and_quiet
}
else {
.msg $chan Sorry $nick $+ , you are not an op in $chan
}
}


I have a similar one set up for deoping. I'm not quite certain how to use the userlist though....could you explain that part in a little more detail?

thanks again!!

shy
Posted By: KingTomato Re: help with op script - 08/12/03 03:45 PM
A userlist can add either a nickname or its mask to a database for reference when a command is said. In this case, i added mask 11 to the database at level 10. Make 11 (not sitting infront of mirc atm, but) looks sort of like:

*!*Shy@mask-A?b?c?.Host.com

This means that any nickname is valid, the ident must match, and the valuable parts of the mask must match. In my experience, this is the most secure mask to use, as it works just as well on a 56k modem (changing ip) as it does with something lik cable. I.E. even if you reconnect to your internet provider, you should still have access.

But the userlist is just a reference point for mIRC. In this occurance, mirc has an on text event. When someone types something in the channel, mirc looks for their name/mask in the user list. So right now say we have the above mask in your user database at level 10. Well if that user were to type something, mirc would look for a match in the database and return the level.

The 10 means that a level 10 and higher can access this command. So in the case of someone joining with:

Shy_and_Quiet!*Shy@mask-A1B2C3.Host.com

You would match *!*Shy@mask-A?b?c?.Host.com because of the wilcards (? = single character, * miltiple or none):

*!*Shy@mask-A?b?c?.Host.com
Shy_and_Quiet!*Shy@mask-A1B2C3.Host.com

So now mirc says "hey, this user is a level 10, this command requires atleast a level 10, let them use this command". From there its just a matter of coding your command.

Hope that helps. >:D
© mIRC Discussion Forums