 |
Winslow Novice
Joined: 17 Feb 2007 Posts: 48
|
Posted: Thu Mar 01, 2007 10:57 am
Err, Shoot me please. |
I should know this already and I'm almost embarrassed to have to ask these questions but I’ve been around the help files a couple of times, tested and worked in this myself about 10 times and then gave up and decided to resort to embarrassment.
Firstly, I want to create a trigger that says,
You’ve lost concentration when casting (spellname)!
Or sometimes
You’ve lost concentration when casting (spellname) (spellname) (spellname)!
And I want to extract the (spellname) text and trigger it to say:
Cast (spellname)
Or
Cast (spellname) (spellname) (spellname)
I’ve tried several variations so far… The last one which I gave up on was:
{You lost your concentration while casting %{spell}!}
cast %spell
or
{You lost your concentration while casting %spell1 %{spell2}!}
cast %spell1 %spell2
Any ideas because I’ve given up already :-P
===========================================
Another point before I go.
I wanted to know if there was a way to extract the hitpoint value, determine if it is lesser then a figure and if so, do an action. I know this illegal on some muds and I cannot deny my ability to possibly use this to illegal ends (which I know will be brought up guys so just shush!) but on some muds its not and also can be used for other valuable possibilitys.
i.e. prompt goes:
{375/375hp}{544/650m}{339/362mv}
Tigger to
{%hpval/375hp}{544/650m}{339/362mv} (or whatever the proper variable is for this, I don’t know)
If %hpval < 50 then cast word of recall
It’s a little like basic here but wanted to know if this is possible in the realm of Zmud. Thanks
- Winslow |
|
|
 |
Winslow Novice
Joined: 17 Feb 2007 Posts: 48
|
Posted: Thu Mar 01, 2007 11:00 am |
Sorry, one more question...
What's the command, inside a trigger, to disable or enable another trigger?
i.e. #triggeroff Joe has arrived.
#triggeron Joe has arrived. |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Mar 01, 2007 11:21 am |
Take a look at the help file for #trigger - there's a link to a help file in there called pattern matching, and it describes the wildcards you can use in your triggers. What you're looking for is this:
#trig {You’ve lost concentration when casting (*)!} {cast %1}
%1 matches the first wildcard. * will match any number of any character, so it'll match both the words and the spaces.
Your second question is a bit more complicated because {} are special characters when used in a trigger pattern. You need to quote them out by putting a ~ before them.
#trig {~{(%d)/%dhp~}~{%d/%dm~}~{%d/%dmv~}} {#if (%1 < 50) {cast word of recall}}
%d matches any number - only the ones in brackets have their values assigned to a %n variable.
Finally, the command to turn a trigger on and off is #T+ and #T-. You can actually use this to turn off any kind of setting - read the help file for it. You can give each trigger an ID. If you're defining them on the command line it goes before the pattern:
#trig "SomeTrigger" {Pattern to match} {commands to execute}
#t- SomeTrigger
#t+ SomeTrigger
You can also use the pattern of the trigger to specify it. |
|
|
 |
Winslow Novice
Joined: 17 Feb 2007 Posts: 48
|
Posted: Fri Mar 02, 2007 2:27 am |
Wow, works like magic. Thanks a load.
- Winslow |
|
|
 |
Winslow Novice
Joined: 17 Feb 2007 Posts: 48
|
Posted: Sun Mar 04, 2007 6:26 am |
Okay, another question which would be of triffic use if I could figure this out:
On this mud there are several continents. I think I have figured out how to load into a variable what cont I’m on and keep that always updated.
I wanted to make a alias so that when I recall, I automatically walk into the hospital for that continent. Obviously there are different paths for different conts. Wanted to know if there is a command that works something like this:
Cast word of recall
If @cont = cont1 then
2s
2e
etc, etc, etc
end if
if @cont = cont2 then
2e
2s
erc, etc, etc
end if
Again, I’m use to basic commands and just can’t seem to translate in my head. Thanks a lot for your help |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sun Mar 04, 2007 3:18 pm |
Yep. You can create paths using the #record command or via the GUI. Then you just do:
#alias recall {~recall;#if (@cont="blah") {#tele 2965;.HospitalBlah};#if (@cont="lol") {#tele 12;.HospitalLol}}
and so on. |
|
|
 |
|
|