mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2003
Posts: 27
T
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?

Joined: Dec 2002
Posts: 788
C
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.

Joined: Dec 2002
Posts: 191
N
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.

Joined: Nov 2003
Posts: 27
T
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...

Joined: Nov 2003
Posts: 27
T
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...

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
did you try using /set %var instead of /var %name =

Joined: Nov 2003
Posts: 27
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Nov 2003
Posts: 27
Yes i did, makes no difference.

Joined: Dec 2002
Posts: 788
C
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.

Joined: Nov 2003
Posts: 27
T
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.


Link Copied to Clipboard