Help - Search - Members - Calendar
Full Version: Wildcards In Zmud And Mush
Achaea's Forums > Off-Topic > Tech Support > Client Help
Trici
Ok, I know how to do this in Nexus:
Trigger:
CODE
{<}(Party): {w} says, "Target: {w}."{>}
Script:
CODE
#set t $2
#echo Target is: $2


I need to know how to do the same thing in Zmud and Mush.
For instance.
(Party): Trici says, "Target: Aegis."
I want to replace Trici and Aegis with a wildcard, then use the second value as the target.

I was also curious, if I wanted to make an alias, such as this in Nexus.
Alias:
CODE
sct
Script:
CODE
#set $t $1
pt Target: $1

How would this work in Zmud/Mush?

If anyone knows some good tutorials, instead of just answering my questions, I would appreciate those instead! Like the one Achaea has for Nexus, that explains what each function. I wanted to start learning to make my own system, but I need the basics.
Dusty
Zmud:

trigger:
CODE
^~(Party~): %w says, ~"Target: (%w).~"

value:
CODE
#VAR t %1


CODE
#TRIGGER {^~(Party~): %w says, ~"Target: (%w).~"} {#VAR t %1}



There are quite a few tutorials for Zmud floating around the forums.
Jonathin
If you want to do Regex (which can be used for both zMUD and MUSH) it would look like:

Pattern: ^\(Party\)\: (\w+) says\, \"Target\: (\w+)\.\"$

Value (for zMUD)
#va target %1 (hard change to the target)
or
t %2 (uses whatever alias you use to target)
Trici
QUOTE (Jonathin @ Mar 9 2009, 06:31 PM) *
If you want to do Regex (which can be used for both zMUD and MUSH) it would look like:

Pattern: ^\(Party\)\: (\w+) says\, \"Target\: (\w+)\.\"$

Value (for zMUD)
#va target %1 (hard change to the target)
or
t %2 (uses whatever alias you use to target)
OOoooo, Regex works for both?
That makes this so much easier, thanks!
Eluned
QUOTE (Trici @ Mar 9 2009, 10:17 PM) *
QUOTE (Jonathin @ Mar 9 2009, 06:31 PM) *
If you want to do Regex (which can be used for both zMUD and MUSH) it would look like:

Pattern: ^\(Party\)\: (\w+) says\, \"Target\: (\w+)\.\"$

Value (for zMUD)
#va target %1 (hard change to the target)
or
t %2 (uses whatever alias you use to target)
OOoooo, Regex works for both?
That makes this so much easier, thanks!


Be sure to tick the little Regex box on the trigger in zMud!
Jonathin
QUOTE (Trici @ Mar 9 2009, 11:17 PM) *
QUOTE (Jonathin @ Mar 9 2009, 06:31 PM) *
If you want to do Regex (which can be used for both zMUD and MUSH) it would look like:

Pattern: ^\(Party\)\: (\w+) says\, \"Target\: (.*)\.\"$

Value (for zMUD)
#va target %2 (hard change to the target)
or
t %2 (uses whatever alias you use to target)
OOoooo, Regex works for both?
That makes this so much easier, thanks!


The bolded is fixed. (you probably knew, but I didn't want to confuse anyone who is learning.

Edit: Also, I changed the target from (\w+) to (.*) because you might want to target something by name, OR number (.*) captures both.
Sena
QUOTE (Jonathin @ Mar 10 2009, 10:16 PM) *
Edit: Also, I changed the target from (\w+) to (.*) because you might want to target something by name, OR number (.*) captures both.

\w already matches letters or numbers. \a is only letters.
Jonathin
Oh doh! I should've known that. My targeting script uses the \w+ and I use numbers all the time. -facepalm-
Trevize
Sena is correct in part. \w does capture any alphanumeric character. \a is normally, however, not letters only. That's how zMUD does it, but with regex it -should- be a bell character (\x07).
Sena
Then again, I forgot that denizens can have other things in their names, like spaces, hyphens, apostrophes, and probably things I'm forgetting. So I would use .* or [a-zA-Z0-9 '-]+
QUOTE (Trevize @ Mar 10 2009, 10:28 PM) *
Sena is correct in part. \w does capture any alphanumeric character. \a is normally, however, not letters only. That's how zMUD does it, but with regex it -should- be a bell character (\x07).

I forgot about that. I've read that before, but I rarely use regex outside of zMUD.
Jonathin
.* is simpler/ smile.gif
Trevize
You can use \w inside a character class, so if you want, this should work:

[\w'-]+

The problem, Jonathin, in using .* is that it catches things you do not want. Such as spaces.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.