|
Denah Newbie
Joined: 08 Dec 2002 Posts: 7
|
Posted: Tue Dec 17, 2002 3:34 am
trigger trouble |
i am trying to get some vriable out of a group command
a group line would look like this
Tyllin [892/1055h 658/658m 242/242v]
@tank %1/%2
#va currenthps %1
current trigger i am using to fill it would be
#TRIGGER {@tank1 %1/%2h} {#var tank1hp %1;#var maxtank1hp %2}
if i put a [ before the %1 in the trigger it no longer works
i have tried a ~[ also before it doesn't work. iif any has any insight please let me know
#va maxhps %2
but %1 looks like this [892 i and to get ride of the [ in the front of it what would i need to do |
|
|
|
demoneyoungblood Apprentice
Joined: 16 Dec 2002 Posts: 114 Location: USA
|
Posted: Tue Dec 17, 2002 4:27 am |
pattern: (%w) ~[(%d)/(%d)h (%d)/(%d)m (%d)/(%d)v~]
Value:
#va tank %1
#va tankhp %2
#va tankmaxhp %3
I think that should solve your problem, you wont need to use the rest of the variables, but it will want the %d's so that it will match it on any numbers.
+------------------+
|Demone YoungBlood|
+------------------+ |
|
|
|
Denah Newbie
Joined: 08 Dec 2002 Posts: 7
|
Posted: Tue Dec 17, 2002 4:24 pm |
tried what you sugested didn't work, when i do that the trigger no longer works
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Dec 17, 2002 4:49 pm |
Read the helpfile on patterns. You should not be using %1, %2, etc. in the trigger pattern. Those are the equivalents of *'s, but zMUD provides much more specific wildcards and reserves the use of %1, %2, etc. to the action part of the trigger.
Since you didn't say, I'm assuming you are using the latest public version, 6.16, and not one of the BETA versions (if you are using a BETA version, you should post on the BETA forum). I'm also assuming you have the default special character set.
#TRIGGER {@tank1 ~[(%d)/(%d)h} {#var tank1hp %1;#var maxtank1hp %2}
LightBulb
Senior Member |
|
|
|
Denah Newbie
Joined: 08 Dec 2002 Posts: 7
|
Posted: Tue Dec 17, 2002 5:37 pm |
i have tried this
#TRIGGER {@tank1 ~[(%d)/(%d)h} {#var tank1hp %1;#var maxtank1hp %2}
when i use that the trigger no longer functions.
I have the default special characters set |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Dec 17, 2002 8:48 pm |
Sorry, but your problem is something peculiar to your own setup. I tested the trigger with @tank1 set to Tyllin, using:
#SHOW {Tyllin ~[892/1055h 658/658m 242/242v~]}
It worked as expected, setting @tank1hp to 892 and @maxtank1hp to 1055.
I'm very curious about your response to demoneyoungblood, "when i do that the trigger no longer works" and to myself, "when i use that the trigger no longer functions". I thought the problem was that the trigger NEVER WORKED IN THE FIRST PLACE. If it already works the way you have it, and stops working when you try our suggestions, then just do it the way you already have it. Problem solved.
LightBulb
Senior Member |
|
|
|
Castaway GURU
Joined: 10 Oct 2000 Posts: 793 Location: Swindon, England
|
Posted: Wed Dec 18, 2002 10:28 am |
I guess (s)he means it doesn't trigger any more..
Theres still the problem of %1 not being a number but text "[892"..
You need to read between the lines a bit..
Denah: Did you also try something less complicated?
#TRIGGER {Tylin%s~[*~/*h} ... ?
Lady C. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Wed Dec 18, 2002 4:48 pm |
Aha! Somehow, I always expect people to be smart enough to see that there's only one space in the pattern here, and add extra spaces where there's more than one on their MUD. But then, I also expect people to catch obvious typos such as Tylin instead of Tyllin, and they almost always miss those too.
Denah:
If your MUD puts more than one space between Tyllin and [892/1055h, add the extra spaces to the pattern, between @tank1 and ~[(%d)/(%d)h
LightBulb
Senior Member |
|
|
|
Denah Newbie
Joined: 08 Dec 2002 Posts: 7
|
Posted: Sat Dec 21, 2002 3:06 am |
the %s after the @tank was the key thanks alot
Denah |
|
|
|
|
|