mIRC Home    About    Download    Register    News    Help

Print Thread
#229700 14/02/11 06:37 PM
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
if someones nick is _

mirc says invalid if for:

if ($nick == $chr(95))

and

if ($nick == _)

what can I do?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Are you sure you're using the correct $chr() or character? There is more than one underscore character available. Find something that nick says (or when the nick joins/parts/etc) and copy/paste the nick and then use that to get the $chr() value for it and try again.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You can copy the exact character and then use
Code:
//echo -a $asc(ChrHere)
to get the numeric value for $chr().

Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
Originally Posted By: Tomao
You can copy the exact character and then use
Code:
//echo -a $asc(ChrHere)
to get the numeric value for $chr().
gives me 95

* /if: insufficient parameters (line 24, script.mrc)

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Please post the exact line. I recommend copy & paste so that there's no chance of you accidentally adding or removing characters in your post to make it different from what is in your code. I also recommend using the Code tags around the line so that spaces are preserved.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
insufficient parameters would indicate one side of your IF statement is missing (or null). You might want to verify that everything in the IF evaluates to something. If you use $nick, make sure $nick has a value (echo -a Nick: $nick right above the IF line). If you have something else, include that in the echo. Test what you have in both sides of the IF statement. Both sides meaning- if (side 1 == side 2) {}

Beyond that, I'd suggest posting the entire event you're using and any associated aliases so someone can check it for errors.


Invision Support
#Invision on irc.irchighway.net
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: firefox
* /if: insufficient parameters (line 24, script.mrc)
That happens when you missed a curly bracket, which is what could have resulted that error:
Quote:
on *:event:*:#: {
if ($nick == $chr(95)) {
;your cmd here
}
}

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ignore the strikethrough part of what I said before. It's incorrect now that I look at it. The error doesn't occur in the case I mentioned.

Originally Posted By: Riamus2
insufficient parameters would indicate one side of your IF statement is missing (or null). You might want to verify that everything in the IF evaluates to something. If you use $nick, make sure $nick has a value (echo -a Nick: $nick right above the IF line). If you have something else, include that in the echo. Test what you have in both sides of the IF statement. Both sides meaning- if (side 1 == side 2) {}

Beyond that, I'd suggest posting the entire event you're using and any associated aliases so someone can check it for errors.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2007
Posts: 202
F
firefox Offline OP
Fjord artisan
OP Offline
Fjord artisan
F
Joined: Sep 2007
Posts: 202
yeah seems I messed up and removed too many { } when modifying the script - doh!

thanks guys

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
You can get away from receiving an error without brackets or parentheses in three ways, but you can't lose both of them:
Code:
if ($nick == $chr(95)) ;My cmd
Or
Code:
if $nick == $chr(95) { ;My cmd }
And Of course, the traditional way with both intact:
Code:
if ($nick == $chr(95)) { ;My cmd }
It's always a good practice to include the brackets and parentheses whenever possible.


Link Copied to Clipboard