 |
Phanku Novice
Joined: 09 Oct 2003 Posts: 40
|
Posted: Wed Mar 31, 2004 7:18 am
Putting decimals into varables |
Okay guys,
I need help.
Here is what my hp bar looks like.
Hp:[349/349] Sp:[258/258] S:[100%] H:[0%] C/M:[1/0/15%] G:15.975
that is while i'm not fighting.
My hp bar looks like this when i am fighting.
Hp:[349/349] Sp:[258/258] S:[100%] H:[1%] C/M:[1/0/26%] G:16.000 E:Scra
Okay so now here is my problem. I would like to put the number that is behind the G: into a varable as one number. But i can't seem to get zmud to do it.
So i would like the varable gxp to say 15.975.
What i'm working for is.. The number behind the G: is a percentage of how far along in my level is so it goes up to 100% (actually it can go above 100, but at 100 i can level). Each round of battle i will gain like 0.0127 (and this number will change each round of battle)percent of my level. What i'm trying to do is make a trigger that would esitmate the number of rounds i have to go yet.
so i would like it to look something like
RTL: 3230 <--- that would be the number of rounds based on the last number it got from the last round of battle tell i level.
If you guys could help me out on this i would be so happy thanks.
Phanku |
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Mar 31, 2004 7:47 am |
I Belive %x (matches all except spaces)would do to capture it to a variable G:(%x)
as for the math part thats all you its late and math hates me :P but I think this is it
roundstogo=%int(%eval(%eval(100-%float(@gxp))/0.0127))
gimmie a min and I might have a complete script for ya (just remember math could be wrong so someone correct me if im wrong :P |
|
|
|
 |
nexela Wizard

Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Wed Mar 31, 2004 8:05 am |
Here goes should give you a general idea and also place it in your prompt for something simple using 0.127 always
PATTERN:
^Hp:~[%d/%d~] Sp:~[%d/%d~] S:~[%d~%~] H:~[%d~%~] C/M:~[%d/%d/%d~%~] G:(%x)
VALUE:
gxp=%1
roundstogo=%int(%eval(%eval(100-%float(%1))/0.0127))
#PSUB {%1 R:@roundstogo} %x1
I think my math is correct then again it is late too :P |
|
|
|
 |
Phanku Novice
Joined: 09 Oct 2003 Posts: 40
|
Posted: Wed Mar 31, 2004 4:13 pm |
OH god. How could i be so stupid. Thanks.
The math part i'm not to worried about. My problem was what paramater to use to get it to take a decimal as a varable.
But hey thanks! It's so awesome. THANKS FOR HELPING. You are the best! =)
Phanku |
|
|
|
 |
|
|
|