Aliases

Posted by Chaosmstr on Tue 09 Sep 2014 04:14 AM — 5 posts, 20,025 views.

#0
Yes, I'm feeling dumb, but I'm learning a lot. Once again it seems to be subtle nuances that I'm missing, but I'm catching on!

I am trying to set up an alias to cast a spell.
Sometimes I want to cast it on myself, sometimes on others.

The following assumes that "armor<cr>" is on me, while "armor joe<cr>" is someone else.

If it's on me, it sets a variable to check if I loose concentration (in which case another trigger keeps casting it till it sticks) and if it's not on me, then I have to re-cast it manually.

Here's the alias.

<aliases>
<alias
match="armor*"
enabled="y"
expand_variables="y"
group="spells"
send_to="12"
sequence="100"
>
<send>if %1 == nil then
SetVariable("carm","1")
send ("cast armor") -- self cast
else
send ("cast armor %1") -- cast on other
end</send>
</alias>
</aliases>

and get an error of:

Error number: 0
Event: Compile error
Description: [string "Alias: "]:1: unexpected symbol near '=='
Called by: Immediate execution

I've tried a %%1 with no success as well.
#1
And how does one set the code in it's own little window like y'all are doing, makes it so much easier to read.
Australia Forum Administrator #2
Chaosmstr said:

And how does one set the code in it's own little window like y'all are doing, makes it so much easier to read.


Template:codetag
To make your code more readable please use [code] tags as described here.
Australia Forum Administrator #3
Template:faq=50
Please read the MUSHclient FAQ - point 50.


This also isn't right:


if %1 == nil then


More like:


if "%1" == "" then


See the FAQ for more details.
#4
RTFM.. Gotcha.
Thanks for your help Nick.
Read the FAQ's first.. gotcha.
Sorry for the timewaster. :)

CM