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
➜ Using Wildcards in Alias's
Using Wildcards in Alias's
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Darcon
(26 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 19 Oct 2012 11:15 PM (UTC) |
Message
| Can you post the whole alias please?
 |
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 | Top |
|
Posted by
| Darcon
(26 posts) 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.
| Top |
|
Posted by
| Darcon
(26 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) 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:
It sends:
cast 'gate' pocket gopher
Isn't that what you want? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Darcon
(26 posts) 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. | Top |
|
Posted by
| Darcon
(26 posts) 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? | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) 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 | Top |
|
Posted by
| Darcon
(26 posts) Bio
|
Date
| Reply #8 on Sun 21 Oct 2012 04:05 AM (UTC) |
Message
| Yeah that did the trick. Thanks once again nick. | 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.
24,680 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top