Need help with IsAlias please?

Posted by Andik on Sun 25 Oct 2009 01:59 AM — 5 posts, 19,099 views.

#0
I can't seem to get IsAlias to work right. It sends me the 30010 (doesn't exist) message even when the alias exists. For example, I have an alias already called "cb", and I enter within another alias:

Note(IsAlias("cb"))

and it returns 30010. Is it the case that there are global/local aliases like there are variables? If this is the case, how could I access a "global alias"? Or, is the function not working? I'm not very good with Lua yet, and I'm doing this in perhaps a overly simple fashion, i.e. I created an alias, put just the above IsAlias line in the send box, and clicked on "script" in the sendto box. Perhaps I just need to enter more information in the send box?
Australia Forum Administrator #1
Are both aliases in the main world file (ie. not in plugins?).

Can you post both aliases please? The one called "cb" and the one which tests if "cb" exists.

Template:copying
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
#2
Yes, neither are in a plugin. I am actually using this in a more complicated script, but I simplified it since I was having problems, and if I can understand it this way, I can easily move it into my more complicated script. Here are the two aliases I am using to test it out with.

<alias
match="checkexists"
enabled="y"
send_to="12"
sequence="100"
>
<send>Note (IsAlias("cb"))</send>
</alias>

<alias
match="cb"
enabled="y"
sequence="100"
>
<send>cast 'blind'</send>
</alias>
<alias
match="cb *"
enabled="y"
sequence="100"
>
Australia Forum Administrator #3
OK, IsAlias("cb") doesn't test on what the alias matches on ("cb" in this case) it tests the alias name. That is, what you put in the "label" field for the alias. Give the alias a name and it will work.
#4
Oh alright, always wondered what good labels were for, here's one answer! Thanks for the quick reply =)