mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
Hey, I'm back again wink.

This isnt working as I hoped.

Code:
 on *:text:!login * *:?: {
  if ($2 == %passw0rd., $+ $2) { set %loggedin., $+ $nick yes | notice $nick You logged in successfully! }
  elseif ($2 != %passw0rd., $+ $2) { notice $nick Wrong password. }
  else { halt }
}
on *:text:!password * *:?: {
  if (%loggedin., $+ $nick == yes) { set %passw0rd., $+ $2 $3 | notice $nick Password for $2 changed to $3 $+ . }
  else { notice $nick You are not logged in. Please log in. Don't have an account? You dont have access. }
} 


Well, I can login, but can't change the password or do commands where I need to be logged in. How can I fix this problem. I think it's a problem with "%loggedin., $+ $nick == yes". Because you cant use spaces before the "==". Well, I don't want many changes, so I need a change on this script. If someone can help me, I'm very happy so.. smile

No, "%loggedin.,$nick == yes" isnt working.

Last edited by Vinniej; 15/02/06 12:50 AM.
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
When posting code please use the Code Tags. You have a habit of using the Quote tags instead. The Code tags are just to the right of the Quote tags.

I did a bit of fixing up of your code, and this should work properly.
Code:
 on *:text:!login & &:?: { 
  if ($($+(%,password.,$2),2) == $2) {
    set $+(%,loggedin.,$nick) yes
    notice $nick You logged in successfully!
  } 
  else { notice $nick Wrong password. } 
} 
on *:text:!password & &:?: { 
  if ($($+(%,loggedin.,$nick),2) == yes) {
    set $+(%,passw0rd.,$2) $3
    notice $nick Password for $2 changed to $3 $+ .
  } 
  else { notice $nick You are not logged in. Please log in. Don't have an account? You dont have access. } 
} 
 


Most likely one question that will occur to you is "what happened to the *?"
I'll answer that now, I replaced them with & which is another wildcard character, but & only matches one word, as * will match any number of words (including none)

If you have any other questions, ask and I'll do my best to explain.

Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
I got "%passw0rd.,#chan <pass>" in my variables. However, It keeps saying I have the wrong password... shocked

Problem fixed.

Last edited by Vinniej; 15/02/06 01:03 AM.
Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
Ok, cant edit my post, but why this following code doesnt work?

Code:
on @*:deop:#: {
  if ($($+(%,loggedin.,$nick),2) == yes) { halt }
  elseif ($+(%,protection.,$chan) == on) { mode $chan +b $address(2,0) | kick $chan $nick You are violating $chan $+ 's rules. Please cease your abuse! | timer1 1 300 mode $chan -b $hostmark }
  else { halt }
}  


Im trying to script a little protection bot, working with NNscript etc smile.

Last edited by Vinniej; 15/02/06 05:56 PM.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
This part needs evaluating:

Code:
 elseif ([color:red]$([/color]$+(%,protection.,$chan)[color:red],2)[/color] == on) {


The else { halt } is kinda pointless as that's what mIRC does anyway.

Joined: Apr 2005
Posts: 64
V
Vinniej Offline OP
Babel fish
OP Offline
Babel fish
V
Joined: Apr 2005
Posts: 64
Quote:
This part needs evaluating:

Code:
 elseif ([color:red]$([/color]$+(%,protection.,$chan)[color:red],2)[/color] == on) {


The else { halt } is kinda pointless as that's what mIRC does anyway.
No, only logged in users are allowed to kick, ban, op, deop.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Yes but if the elseif statement isn't matched mIRC will just not execute anymore commands anyway, so the else { halt } part is not needed.


Link Copied to Clipboard