mIRC Home    About    Download    Register    News    Help

Print Thread
#231520 21/04/11 12:20 PM
D
D00M
D00M
D
Hi guys ,Im trying to make a password script for Ops in the channel.We have bots to auto op etc but the prob is we have several ops that have dynamic hosts and change a lot so I wanted to make a password ops script for them to gain ops.

Code:
on *:TEXT:!op *:?:{
  $iif($2 === PASSWORD_HERE && $me isop #MY_CHAN,mode #MY_CHAN +o $nick,.notice $nick Sorry but your password is incorrect!)
/close -m $nick
}


The above works fine but I can only set it for a single user unless I have them all on the same pass (they want to use their own passwords).So what I'm after is some help in setting up a multi user password script,something like:

<user1>!op MY_PASS(incorrect pass)
<bot>!Sorry that password is incorrect!
<user1>!op MY_PASS(wrong nick ,right pass or vis versa)
<bot> Sorry your nick doesnt match the assigned password!.
<user2>!op MY_PASS(correct pass and nick)
<bot> Match Found,you are now op!.
<some_randome_user> hello
<bot> Do not PM me use the channel

I need to be able to add multiple users with a password for them each.When an incorrect pass is found or a nick/pass miss match,have the script notice them the pass or nick is incorrect.When a user pm's with the correct pass,a notice saying Match Found etc.. and the bot ops them if both nick and pass match.If some random user PM's the bot have it notice them to use the channel


TIA
D00M.

#231522 21/04/11 02:49 PM
5
5618
5618
5
This should work. Place a file.txt in your $mircdir (//echo -a $mircdir) with the format:

nick1 password1
nick2 password2

Then add these two events to your Remote script file. It's import that the !op even comes first.
Code:
on *:TEXT:!op *:?:{
  if ($me !isop #MY_CHAN) .msg $nick Sorry, but I am current not opped in #MY_CHAN so I cannot give anyone operator mode.
  elseif ($read(file.txt,sn,$2) == $null) .msg $nick Sorry, but that nickname is not familiar to me.
  elseif ($read(file.txt,sn,$2) !=== $3) .msg $nick Sorry, but that password is not correct.
  else { .msg $nick Match found, you are now an operator! | mode #MY_CHAN +o $nick }
  close -m $nick
}
on *:TEXT:*:?:{ .msg $nick Do not PM me, use the channel instead. | close -m $nick }

Edit: corrected some mistakes (again -.-).

Last edited by 5618; 21/04/11 03:12 PM.
#231525 21/04/11 06:46 PM
Joined: Jul 2007
Posts: 1,124
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,124
I think it's fitting to use INI for this. Using TXT will have to make sure that the nick and password exist to avoid duplicates.

Tomao #231526 21/04/11 06:51 PM
5
5618
5618
5
While what you say is true, it's unlikely to be a problem here.
And only nick duplicates would be a problem.

#231533 22/04/11 09:16 AM
D
D00M
D00M
D
Thanks 5618 i'll give it a shot wink


Link Copied to Clipboard