mIRC Homepage
Posted By: Tezorian Custom identifier fails. Why? - 07/07/04 12:48 PM
This is a problem that is REALLY bugging me.
---
var %usernfo = $hget(Userlist,$1)
.echo 8 -s %usernfo
if (%usernfo == $null) { return $null }
---

This is the beginning of my custom identifier.
All seems good and well. However. Line 1 reads the nfo.
Line 2 SHOWS the nfo in the status window.
BUT, and here comes the annoying part. Line 3 gets triggered. What is the deal here?
I have added line 2 infront of the return command and there the %usernfo is $null.
However, AFTER line 3, if i add the .echo again, the %usernfo contains the data again?????

Can someone tell me IF i am missing something here?
Posted By: Coolkill Re: Custom identifier fails. Why? - 07/07/04 12:52 PM
Looks like fun, should work though, try:

if (!%variable) { return $null }

Although, this works fine for me:

alias custom {
var %usernfo = test
.echo 8 -s %usernfo
if (%usernfo == $null) { return - $null }
else { return %usernfo }
}

//echo -> $custom

Although if its 'return' then the echo after the == $null line wouldnt be echo'd anyway.. check that too.. although If something dodgy is going on and it doesnt work, might want to check there isnt another alias with the same name somewhere (Older Version).. failing that, try using /set not /var.

Eamonn.
Posted By: Nobodi Re: Custom identifier fails. Why? - 07/07/04 12:58 PM
Quote:

However, AFTER line 3, if i add the .echo again, the %usernfo contains the data again?????


If it echo's the data in the variable its not that line that is returning $null as nothing after the return would be processed.
Posted By: Tezorian Re: Custom identifier fails. Why? - 07/07/04 01:08 PM
indeed. That was the other thing i couldn't quite grasp.
The script continues to run, even after returning data...
Posted By: Tezorian Re: Custom identifier fails. Why? - 07/07/04 01:28 PM
Ok, i still can't figure it out. If anyone knows, please reply.

Right now i have replace all instances of %usernfo with $hget(Userlist,$1)
Now it DOES work... for now at least...
Posted By: Coolkill Re: Custom identifier fails. Why? - 07/07/04 01:34 PM
did you try using /set %var instead of /var %name =
Posted By: Tezorian Re: Custom identifier fails. Why? - 07/07/04 01:54 PM
Yes i did, makes no difference.
Posted By: Coolkill Re: Custom identifier fails. Why? - 07/07/04 01:55 PM
and what about the alias i posted above? cant really see where your problem is.. it looks fine from here.

Eamonn.
Posted By: Tezorian Re: Custom identifier fails. Why? - 08/07/04 08:11 PM
I have a second identifier set up just like this one.
Same thing, just different hash and items. That one works.

Yours works too, but i tested something similar myself before.
I just couldn't figure out why this one didn't work.
© mIRC Discussion Forums