Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Aliases

Aliases

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Chaosmstr   (21 posts)  Bio
Date Tue 09 Sep 2014 04:14 AM (UTC)
Message
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.
Top

Posted by Chaosmstr   (21 posts)  Bio
Date Reply #1 on Tue 09 Sep 2014 04:14 AM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 09 Sep 2014 05:35 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,165 posts)  Bio   Forum Administrator
Date Reply #3 on Tue 09 Sep 2014 05:37 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Chaosmstr   (21 posts)  Bio
Date Reply #4 on Tue 09 Sep 2014 05:52 AM (UTC)
Message
RTFM.. Gotcha.
Thanks for your help Nick.
Read the FAQ's first.. gotcha.
Sorry for the timewaster. :)

CM
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,233 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.