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
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Wed Jul 27, 2005 2:15 pm   

help with variables
 
In the world of Merentha, your max vitals are only displayed with certain commands. I'm trying to create variables for these maxes so my health stamina and mana gauge maxes will automaticly adjest themselves without me having to change it everytime the value is increased or decreased.

The line looks like this when your maxes are displayed.
Code:
You say: I have 2098/2098 hp, 1011/1011 sp, 1400/1400 mp


This is what my trigger looks like so far.
Code:
#TR {You say: I have (d)/(%d) hp, (d)/(%d) sp, (d)/(%d)mp } {
  #VAR hpsmax %4
  #VAR spmax %5
  #VAR mpmax %6
  } {}

I'm useing 4 5 6 because 1 2 3 is used in another trigger to capture my current vitals for the guage from prompt. I'm not sure if this is the correct way to do it but it doesn't seem to work reguardless of what I change those to.

My problem is this. No matter what I do the variables simply contain a value of % and the number, instead of captureing a real number. Any assistance in this would be greatly appreciated.
Reply with quote
Maelstrom
Apprentice


Joined: 10 Feb 2005
Posts: 158

PostPosted: Wed Jul 27, 2005 2:33 pm   
 
(d) will look for a literal "d" in the trigger line so this trigger is (probably) never firing.
The %1, %2 etc are the matches from the trigger line which is in parenths. In your example above they would be spmax, the literal d, and mpmax...
Try this:

#TRIGGER {^You say: I have %d/(%d) hp, %d/(%d) sp, %d/(%d)mp} {
#VAR hpsmax %1
#VAR spmax %2
#VAR mpmax %3
}
Reply with quote
trpstrife
Novice


Joined: 26 Jul 2005
Posts: 34

PostPosted: Wed Jul 27, 2005 2:52 pm   
 
Ok thanks for the info. After trying your code it still wasn't working but after remove the ^ and realizeing there needed to be a space between the last (%d) and mp it fired right up. Thanks for all your help and thanks for teaching me a lil more about how to code.
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