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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Wed Dec 18, 2013 1:38 pm   

Floating variable
 
I believe i need a different type of variable to capture and translate this capture to show a number value... If someone knows a way to do that could you please show me an example?


^Hp~: ~|----------*~| Gp~: ~|*----------~| Gxp~: ~|----*----------------~| P~:(%w)$

need 3 different variables to mark the position of the asterisk, so the capture can be changed from "---*-----" to 0-100%

thanks in advance, and much appreciated!!!
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed Dec 18, 2013 4:15 pm   
 
You'll want to work with %pos then. You could construct a trigger like such:

Code:

#TRIGGER {^Hp~: ~|(*)~| Gp~: ~|(*)~| Gxp~: ~|(*)~| P~:(%w)$} {$HpPos = %pos("*", %1);$GpPos = %pos("*", %2); $GxpPos = %pos("*", %3)}


The value returned for each %pos will be where the * is at on the line graph. For instance:

Quote:
----*----


will return a value of 5 for the *.

Then you can do what you need to do with the variables.
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Thu Dec 19, 2013 9:43 pm   
 
cool beans! thanks:)
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Thu Dec 19, 2013 9:48 pm   
 
hrrrm , seems to allow a fatal looping when i tried it on my client. is there a way to no capture it that way, because there are several things in the mud that use Hp: or Sp: and the like... so i think it's seeing any of those, and looping.

also if i wanted to set the variables to HpPos to say 1-10 = 0-100% how would i do that heh...
Reply with quote
chris123zugg
Apprentice


Joined: 23 Aug 2013
Posts: 175

PostPosted: Thu Dec 19, 2013 11:36 pm   
 
hrrrm , seems to allow a fatal looping when i tried it on my client. is there a way to no capture it that way, because there are several things in the mud that use Hp: or Sp: and the like... so i think it's seeing any of those, and looping.

also if i wanted to set the variables to HpPos to say 1-10 = 0-100% how would i do that heh...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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