Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Denah
Newbie


Joined: 08 Dec 2002
Posts: 7

PostPosted: 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
Reply with quote
demoneyoungblood
Apprentice


Joined: 16 Dec 2002
Posts: 114
Location: USA

PostPosted: 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|
+------------------+
Reply with quote
Denah
Newbie


Joined: 08 Dec 2002
Posts: 7

PostPosted: Tue Dec 17, 2002 4:24 pm   
 
tried what you sugested didn't work, when i do that the trigger no longer works
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Denah
Newbie


Joined: 08 Dec 2002
Posts: 7

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: 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.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: 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
Reply with quote
Denah
Newbie


Joined: 08 Dec 2002
Posts: 7

PostPosted: Sat Dec 21, 2002 3:06 am   
 
the %s after the @tank was the key thanks alot

Denah
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net