mIRC Home    About    Download    Register    News    Help

Print Thread
#109824 01/02/05 08:12 PM
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
hi,i wana make a password script and i have no idea how,but i do no what it's like
this is what its like:
when someone join the channel,the bot ask the user the password,if they answer the password right they get to stay on then channel,if they're wrong they'r kicked,and if they dont answer the bot,they get to say 3 thing before the bot kick em,and i also like a script that changeds the password,
so anyone have an idea,cuz i need it,thanks


practice makes perfect... smile
#109825 01/02/05 09:00 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
type /set %p_chan #YOUR_CHANNEL_NAME
and /set %p_pass YOURPASSWORD
and then add the following code block to your remotes (alt-r).

The user has to type /notice YOURBOTNAME pass PASSWORD

Your 'password changing script' is simply:
/set %p_pass NEWPASSWORD

or you can make some simple alias like
alias newpass { set %p_pass $$1 }

Code:
ON @*:JOIN:%p_chan: { 
  .notice $nick Please type /notice $me pass PASSWORD to stay on this channel, or you will be removed.
  .set %pass. [ $+ [ $nick ] ] 3
}

ON @*:TEXT:#YOURCHANNEL: {
  if (%pass. [ $+ [ $nick ] ]) {
    dec %pass. $+ $nick
    if (%pass. [ $+ [ $nick ] ] == 0) {
      p_remove $nick $fulladdress
    }
  }
}

ON ^*:NOTICE:pass *:?: {
  if (%pass. [ $+ [ $nick ] ] && $nick ison %p_chan) {
    if ($2 != %p_pass) {
      .notice $nick Incorrect password, removing you from %p_chan
      p_remove $nick $fulladdress     
    }
    else {
      .notice $nick Correct password, thank you.
      unset %pass. $+ $nick
    }
  }
  haltdef
}

alias -l p_remove {
  mode %p_chan -ob $$1 $mask($$2,3)
  kick %p_chan $$1 You are not allowed in this channel
  unset %pass. $+ $$1
}


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
#109826 01/02/05 09:33 PM
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
i tryed it,it doenst work and its so confusing confused


practice makes perfect... smile
#109827 01/02/05 11:40 PM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
ive got a version in my bot
but the way it works is if you type the password which is the content of %x it add whatever follows to the user list
i dont know if it will help but here u go
i keep this for if im ever abroad
Code:
 
#remoteaccess on
on *:text:!ruser *:*:{
  if ($ulevel >= 4) { 
    ruser $$2 
    closemsg $nick  
  }
}
 [color:red]on *:text:!pass *:*:{ 
  if ($ulevel >= 4) { 
    unset -s %x 
    set -s %x $$2-  
    closemsg $nick  
  }
} 
on *:text:*:*:{
  if ($1 = %x) { 
    auser $$2- 
    closemsg $nick  
  } 
}
[/color]#remoteaccess end
 

you can easily modify this so that it sets a user level dor them useing $address
then just make the function you want them to be able to access available to that level

Last edited by ricky_knuckles; 01/02/05 11:42 PM.

The Kodokan will move you, one way or another.
#109828 02/02/05 12:17 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i threw this together but it doesnt work which is interesting
Code:
  
alias /pass {
  set %x $$1
}
on @*:join:#:{
  msg $nick enter the pass please.
  timer $+ $nick 1 20 kick $chan $nick
closemsg $nick
}
on @*:text:!pass *:?:{
  if ($$2- = %x) { 
    timer $+ $nick off
    closemsg $nick  
  } 
}

Last edited by ricky_knuckles; 02/02/05 12:18 AM.

The Kodokan will move you, one way or another.
#109829 02/02/05 12:28 AM
Joined: Dec 2004
Posts: 81
N
Babel fish
Offline
Babel fish
N
Joined: Dec 2004
Posts: 81
Code:
; channel lockout

ON !*:JOIN:#channelname:{
  .notice $nick You must type /notice $me PASS <password> to stay in this $&
    channel. If you dont respond you have the ability to say three lines until $&
    you are forced out of this channel. Thank you.
  if (!$evalnext($+(%,keepout.,$site))) {
    set $+(%,keepout.,$site) 3
  }
}

ON @*:TEXT:*:#channelname:{
  if ($nick ison $chan) {
    if ($evalnext($+(%,keepout.,$site))) {
      if ($evalnext($+(%,keepout.,$site)) <= 3) { dec %keepout. [ $+ [ $site ] ] }
      if ($evalnext($+(%,keepout.,$site)) <= 0) {
        ban -u120 # $nick 3
        kick # $nick You've been warned and havent identified to me in which you are $&
          now not welcome here. [2min ban]
        unset %keepout. [ $+ [ $site ] ]
      }
    }
  }
}

ON !*:NOTICE:pass *:?:{
  if ($2 == %keepoutPASS) {
    if ($evalnext($+(%,keepout.,$site))) {
      .notice $nick Password accepted!
      unset %keepout. [ $+ [ $site ] ]
    }
  }
  elseif ($2 != %keepoutPASS) { .notice $nick Password incorrect. }
}


You have to set %keepoutPASS to the password you want.
Also I'm using $site just for protection from people who want to change their nicknames and attempt to avoid the script. This method isnt completely secure due to the fact that some irc server software like UnrealIRCD prefixes users host upon connecting. Then the user can simply change the mode +x to -x meaning their hostmask wont be prefixed anymore.

#109830 02/02/05 12:43 AM
Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
The reason it doesn't work is because of the @ part of your on @*:text:!pass *:?: event, it's not possible to be an operator in a query so the event will never be triggered while the @ is there.


New username: hixxy
#109831 02/02/05 01:55 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
thanks


The Kodokan will move you, one way or another.
#109832 03/02/05 12:45 AM
Joined: Mar 2004
Posts: 96
G
Babel fish
Offline
Babel fish
G
Joined: Mar 2004
Posts: 96
Nevermind, figured it out smile

Last edited by Gremel; 03/02/05 01:45 AM.
#109833 03/02/05 06:13 PM
Joined: Dec 2004
Posts: 80
C
Babel fish
OP Offline
Babel fish
C
Joined: Dec 2004
Posts: 80
ya...but how do i change the password and stuff?
i just want a simple password script that do what i desribed...


practice makes perfect... smile
#109834 03/02/05 10:12 PM
Joined: Mar 2004
Posts: 96
G
Babel fish
Offline
Babel fish
G
Joined: Mar 2004
Posts: 96
When ever you wish to change the password, just change the $keepoutPASS to your password.

ie)

$keepoutPASS changed to GREMEL

#109835 03/02/05 11:30 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
When ever you wish to change the password, just change the $keepoutPASS to your password.

ie)

$keepoutPASS changed to GREMEL


^ ummm u mean %keepoutPASS, there is no alias by that name.

#109836 06/02/05 06:24 AM
Joined: Mar 2004
Posts: 96
G
Babel fish
Offline
Babel fish
G
Joined: Mar 2004
Posts: 96
oops, not used to typing % frown


Link Copied to Clipboard