mIRC Homepage
Posted By: TheWarlock help prv msg - 02/01/09 07:09 PM
on 1:open:?: {
.notice $Me $nick te manda un privado
.if %nick isin %nolist { .echo -a 1,8Testeando.. }
.if %nick && %ve == 1 { .echo -a 1,3Aprobado )
else %nick && %ve == 0 { .notice $Nick no has sido aceptado | close -m $NIck | halt }
}
}
}

i made this , but doesnt work,any help

if the nick is on the list, it will be accepted else close the window

thnx

Posted By: 5618 Re: help prv msg - 02/01/09 07:29 PM
Please explain what %nick means and what %ve means, and what values they have.
Posted By: argv0 Re: help prv msg - 02/01/09 10:16 PM
you have 2 syntax problems:

1) your "else" has a condition.. else blocks never have a condition. Please read /help /if to look at the syntax for if/elseif/else-- you probably want elseif.

2) you have two independent if branches. both will execute-- meaning if %ve is 0, you will *always* close the window, regardless of the initial check for the list. This is what is happening:

if (%nick isin %nolist) ...

followed by:

if (%nick && %ve) ...
else ...

both of these branches will get executed. it will check if the nick is in the list, and THEN check if %ve is 1 or 0. If it is 0, it will close the window. Your second "if" should be an "elseif" if you want it to only execute the first matched condition of the three.
Posted By: TheWarlock Re: help prv msg - 02/01/09 11:43 PM
i dont get it , can you showme some example thnx
Posted By: TheWarlock Re: help prv msg - 02/01/09 11:43 PM
i dont get it , can you showme some example thnx
Posted By: argv0 Re: help prv msg - 03/01/09 12:24 AM
Examples can be found in the help file under /help /if, others may write more complete examples (aka "write it for you")
Posted By: DJ_Sol Re: help prv msg - 04/01/09 12:18 AM
Examples ...

if (comparison) { command }
elseif (comparison) { command }
else { command }


I read it as a sentence.

If such and such is true, do this command.
Else if such and such is true do THIS command.
else do this command ....

The thing is, when you have an if statement it will evaluate the comparison and if it is true it will perform the command. Then it will move on to the next line UNLESS you return or halt or use elseif or else.

When you read it like a sentence it makes sense.

if (this is true) { do this }
elseif (this is true) { do this }
else { do this }




Code:
on 1:open:?: {
.notice $Me $nick te manda un privado 
if (%nick isin %nolist) { .echo -a 1,8Testeando.. }
elseif (%nick) {
if (%ve == 1) { .echo -a 1,3Aprobado ) 
elseif (%ve == 0) { .notice $Nick no has sido aceptado | close -m $NIck | halt } 
}
}
}


Try this, I don't really know the point or the different variables so I couldn't give you the best option.
© mIRC Discussion Forums