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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Using Wildcards in Alias's
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Using Wildcards in Alias's

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


Posted by Darcon   (26 posts)  [Biography] bio
Date Fri 19 Oct 2012 05:32 PM (UTC)
Message
Ok, bare in mind that I am still very new to this, so don't laugh at me. In the mud that I play there is a gate spell. the syntax for the spell is:

cast 'gate' "whatever you want to gate to"

In the other client that I was using this was a relatively simple alias to create, because an alias could be used with out wildcards i.e.

cgate pocket gopher

After setting up the alias "cgate" in mush client and getting several "Huh?" in return I figured out the wildcard part.

The problem that i am running into is that some gate mobs require one word, some require three. Now I know I could just make several alias's to do what I want to accomplish.

cgate *
cgate * *
cgate * * *
etc...

I would rather not do that though because it makes things harder to find the more you add. So, my question is, is there a way to create an alias with an unknown amount of wildcards available to use?

I realize that this is probably covered in some other subject somewhere but searching through them has yielded very little results for me. I don't know the keywords that I should use.

At any rate, any help on this subject would be appreciated. Even if its just a link to a tutorial or something. Thanks for your patients with me.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 19 Oct 2012 11:15 PM (UTC)
Message
Can you post the whole alias please?

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.


The quick answer is that "cgate *" will match any number of words, so there must be more to your problem than that.

- Nick Gammon

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

Posted by Darcon   (26 posts)  [Biography] bio
Date Reply #2 on Fri 19 Oct 2012 11:34 PM (UTC)
Message
The One that I have initially set up is

cgate *

In the send

cast 'gate' %1

I realize that I can set another one up to do

cgate * *

send

cast 'gate' %1 %2

and so on, but i figure there has to be a way to just use one alias to take care of this for a undertermined amount of wildcards.

That way I can do something like

cgate a crowd of rowdy onlookers

with out have to set up an individual alias

cgate * * * * *

send

cgate %1 %2 %3 %4 %5

I hope that makes sense. Thank for the help.

[Go to top] top

Posted by Darcon   (26 posts)  [Biography] bio
Date Reply #3 on Fri 19 Oct 2012 11:38 PM (UTC)

Amended on Sat 20 Oct 2012 02:05 AM (UTC) by Nick Gammon

Message

<aliases>
  <alias
   match="cgate *"
   enabled="y"
   group="Spells Target"
   sequence="100"
  >
  <send>cast 'gate' %1</send>
  </alias>
</aliases>



This is the one I have now. It only matches one wildcard. Anything after 1 wildcard returns a Huh?

Sorry about the previous post...I caught on to what you wanted after I had already sent it.
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sat 20 Oct 2012 02:07 AM (UTC)
Message
I don't quite get your problem. Using that alias, if I type:


cgate pocket gopher


It sends:


cast 'gate' pocket gopher


Isn't that what you want?

- Nick Gammon

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

Posted by Darcon   (26 posts)  [Biography] bio
Date Reply #5 on Sat 20 Oct 2012 05:54 AM (UTC)

Amended on Sat 20 Oct 2012 05:58 AM (UTC) by Nick Gammon

Message
The problem I was running into was getting the alias to execute in the script I was writing. Maybe I was just tired, I don't know. I have since went back over the script and finally got it working using the original alias I had set up.


<triggers>
  <trigger
   enabled="y"
   group="Xp Run"
   match=" The Glyph of Transportation"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable("Glyph", GetVariable ("Glyph") + 1)
if GetVariable ("Glyph") == "1" then
world.Execute ("cgate pocket gopher")
elseif GetVariable ("Glyph") == "2" then
world.Execute ("north")
world.Execute ("north")
world.Execute ("oass") -- order all sleep spring alias
world.Execute ("west")
world.Execute ("on") -- open north alias
world.Execute ("north")
world.Execute ("north")
world.Execute ("sell tower") -- starts my sell item trigger
end</send>
  </trigger>
</triggers>


It is possible that I had some character incorrect, but I have fixed it and it works. Thank you for your timely responses. Sorry to have wasted your time.
[Go to top] top

Posted by Darcon   (26 posts)  [Biography] bio
Date Reply #6 on Sat 20 Oct 2012 06:06 AM (UTC)
Message
In the second part of the script if I change the 2:

world.Execute ("north")
world.Execute ("north")

to

world.Execute ("2n")

It doesn't work. Any idea why?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sun 21 Oct 2012 12:11 AM (UTC)
Message
You mean you want the speedwalk evaluated?

Try:


 world.Execute (EvaluateSpeedwalk ("2n"))

- Nick Gammon

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

Posted by Darcon   (26 posts)  [Biography] bio
Date Reply #8 on Sun 21 Oct 2012 04:05 AM (UTC)
Message
Yeah that did the trick. Thanks once again nick.
[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.


4,598 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]