[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Aliasing a command with two variables

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Aliasing a command with two variables
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Rena   (9 posts)  [Biography] bio
Date Sun 22 Mar 2009 03:49 AM (UTC)  quote  ]
Message
That was it! I fixed the alias I had set up for targetting and everything works beautifully now. I'll have to be more careful with new lines in the future. Thank you both for the help.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 22 Mar 2009 01:45 AM (UTC)  quote  ]
Message
I think Chyort is right. Your target variable sounds like it has a newline in it, which would cause what you describe.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Chyort   USA  (35 posts)  [Biography] bio
Date Sun 22 Mar 2009 01:15 AM (UTC)  quote  ]
Message
This is a simple example of what your after, if i read your post right.

2 aliases to set the variables. and one alias to send them.
i have it set to "fire" but you can change it easy enough... and having it send "evoke lighting @target @direction"

looking at your aliases, i cant see why its adding a 2nd line... i would guess its something wrong with the way your trying to set your variables though... your adding an extra line in the variable. and thats why its messing up perhaps? duno.


<aliases>
  <alias
   match="^dir[ ]+(.*?)$"
   enabled="y"
   variable="direction"
   regexp="y"
   send_to="9"
   ignore_case="y"
   sequence="1"
  >
  <send>%1</send>
  </alias>
  <alias
   match="^target[ ]+(.*?)$"
   enabled="y"
   variable="target"
   regexp="y"
   send_to="9"
   ignore_case="y"
   sequence="1"
  >
  <send>%1</send>
  </alias>
  <alias
   match="fire"
   enabled="y"
   expand_variables="y"
   sequence="1"
  >
  <send>evoke lightning @target @direction</send>
  </alias>
</aliases>
[Go to top] top

Posted by Rena   (9 posts)  [Biography] bio
Date Sat 21 Mar 2009 09:29 PM (UTC)  quote  ]
Message
Thanks for the response. The FAQ point doesn't address my particular problem though; I think I put my question badly. I don't want to have a command able to respond to optional wildcards; I want a command that can respond to a variable that's in the middle of the command. Here, I think, are the main variations I've tried:

<aliases>
<alias
match="li *"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>evoke lightning @target %1</send>
</alias>
</aliases>


<aliases>
<alias
match="lin"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>evoke lightning @target north</send>
</alias>
</aliases>


<aliases>
<alias
match="li"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>evoke lightning @target @direction</send>
</alias>
</aliases>

I also tried, based on the help file you sent me, variations on this:

<aliases>
<alias
match="li*"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>evoke lightning @target %1</send>
</alias>
</aliases>

But I had the same problem. In all these cases, what I end up with is that it interprets it as two separate commands: "evoke lightning dragon" (or whatever my target is), and "north", rather than as one command "evoke lightning dragon north", which is what I need.
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 21 Mar 2009 07:43 PM (UTC)  quote  ]
Message
See http://mushclient.com/faq point 50.

If that doesn't help, show what you are actually doing:

http://mushclient.com/pasting


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Rena   (9 posts)  [Biography] bio
Date Fri 20 Mar 2009 08:22 PM (UTC)  quote  ]
Message
I want to be able to have an alias "li" for "evoke lightning @target @direction", or failing that, "li *" for "evoke lightning @target %1", or failing that, at least "lie" for "evoke lightning @target east". Any of those would work for me. But I can't seem to get any of those three to work. No matter what one I try, it interprets "evoke lightning @target" as a complete command, and then executes the direction separately, so I end up with a failed command, and then going east.

I think at some point I had one alias set up for "evoke lightning @target", and then if we suppose the alias I chose for that command was "li", then I had a second alias set up for "li north" - but after fiddling with the settings every configuation I could think of, I can't figure out how to get that to work either.

What can I do to get some command like this to work?
[Go to top] 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.


1,448 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]