mIRC Home    About    Download    Register    News    Help

Print Thread
Custom identifier fails. Why? #89454 07/07/04 12:48 PM
Joined: Nov 2003
Posts: 27
T
Tezorian Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
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?

Re: Custom identifier fails. Why? #89455 07/07/04 12:52 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
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.

Re: Custom identifier fails. Why? #89456 07/07/04 12:58 PM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
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.

Re: Custom identifier fails. Why? #89457 07/07/04 01:08 PM
Joined: Nov 2003
Posts: 27
T
Tezorian Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
indeed. That was the other thing i couldn't quite grasp.
The script continues to run, even after returning data...

Re: Custom identifier fails. Why? #89458 07/07/04 01:28 PM
Joined: Nov 2003
Posts: 27
T
Tezorian Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
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...

Re: Custom identifier fails. Why? #89459 07/07/04 01:34 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
did you try using /set %var instead of /var %name =

Re: Custom identifier fails. Why? #89460 07/07/04 01:54 PM
Joined: Nov 2003
Posts: 27
T
Tezorian Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
Yes i did, makes no difference.

Re: Custom identifier fails. Why? #89461 07/07/04 01:55 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
and what about the alias i posted above? cant really see where your problem is.. it looks fine from here.

Eamonn.

Re: Custom identifier fails. Why? #89462 08/07/04 08:11 PM
Joined: Nov 2003
Posts: 27
T
Tezorian Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
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.