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
Wakka
Newbie


Joined: 09 Apr 2003
Posts: 7

PostPosted: Sat Apr 12, 2003 7:26 pm   

need help with a script I'm trying to work on..
 
#CLASS {Stat Bars}
#VAR hit {1732} {0}
#VAR gp {280} {0}
#VAR maxgp {280} {0}
#VAR maxhp {1732} {0}
#VAR cxp {9387} {0}
#VAR goodxp {150000} {150000}
#TRIGGER {Hp: &%dhit?&%dmaxhp} {}
#TRIGGER {Gp: &%dgp?&%dmaxgp} {}
#TRIGGER {Xp: &%dcxp} {}
#BUTTON 1 {Hp: @hit} {} {} {} {@hit} {} {} {Size} {120} {20} {} {} {} {32832} {} {Gauge||4|@maxhp|@maxhp/5|7} {} "" {Explore|Inset} {} {}
#BUTTON 2 {Gp: @gp} {} {} {} {@gp} {} {} {Size} {120} {20} {} {} {} {32784} {} {Gauge||1|@maxgp|@maxgp/5|7} {} "" {Explore|Inset} {} {}
#BUTTON 3 {Xp: @cxp} {} {} {} {@cxp} {} {} {Size} {120} {20} {Pos} {1} {1016} {64} {} {Gauge||12|@goodxp|@cxp|7} {} "" {Explore|Inset} {} {}
#CLASS 0

The thing is I have 2 versions of the hp text and gp text given to me from the mud. So sometimes it screws it up and puts the wrong number into the bar. The xp part works fine because it doesn't have a max.

It works with
Hp: 1732(1732) Gp: 280(280) Xp: 9387

But not
Hp: 1732 (1732) Gp: 280 (280) Xp: 8174


Any help?


~Wakka
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Apr 12, 2003 8:40 pm   
 
If you have two patterns to match, write two triggers.
#TR {Hp: (%d) ~((%d)~) Gp: (%d) ~((%d)~)} {#VAR hp %1;#VAR maxhp %2;#VAR gp %3;#VAR maxgp %4}

LightBulb
Advanced Member
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Apr 12, 2003 8:47 pm   
 
What I have done here is take your three different triggers and made them into two seperat ones with all of it as one trigger.

#CLASS {Stat Bars}
#VAR hit {1732} {0}
#VAR gp {280} {0}
#VAR maxgp {280} {0}
#VAR maxhp {1732} {0}
#VAR cxp {8174} {0}
#VAR goodxp {150000} {150000}
#TRIGGER {Hp: &hit~(&maxhp~) Gp: &gp~(&maxgp~) Xp: &cxp} {}
#TRIGGER {Hp: &hit ~(&maxhp~) Gp: &gp ~(&maxgp~) Xp: &cxp} {}
#BUTTON 1 {Hp: @hit} {} {} {} {@hit} {} {} {Size} {120} {20} {} {} {} {32832} {} {Gauge||4|@maxhp|@maxhp/5|7} {} "" {Explore|Inset} {} {}
#BUTTON 2 {Gp: @gp} {} {} {} {@gp} {} {} {Size} {120} {20} {} {} {} {32784} {} {Gauge||1|@maxgp|@maxgp/5|7} {} "" {Explore|Inset} {} {}
#BUTTON 3 {Xp: @cxp} {} {} {} {@cxp} {} {} {Size} {120} {20} {Pos} {1} {1016} {64} {} {Gauge||12|@goodxp|@cxp|7} {} "" {Explore|Inset} {} {}
#CLASS 0

It was not necessery to have different ones for the sam prompt capture so I made them one without the spaces and another for the spaces I tried both and they worked for me.

Hope this helps...

megamog75
Keeper of the only printable help files for Zmud.
Reply with quote
Wakka
Newbie


Joined: 09 Apr 2003
Posts: 7

PostPosted: Sat Apr 12, 2003 8:58 pm   
 
Thanks Lightbulb yours worked perfect!

Thanks again everyone!
Reply with quote
Wakka
Newbie


Joined: 09 Apr 2003
Posts: 7

PostPosted: Sun Apr 13, 2003 5:35 pm   
 
I need some more help.... since the mud I play on has several ways to look at the score/stats


You have 1732 (1732) hit points, 280 (280) guild points, 70 (723) quest points and 213 (213) social points.
Your current experience is 36447 and you are level 157 in the Wizards' Guild; your overall rating is 12440.
You have died 9 times and can die 2 times before you are completely dead.
Your wimpy is set to 20%.
You are burdened (60%) and quite comfortable.
You are neutral, worshipping no god.
You are a magistrate of: Ankh-Morpork.
You are 31 days, 8 hours, 24 minutes and 6 seconds old and have logged in 781 times.

You have 1732 (1732) hit points - @hp (@maxhp)
280 (280) guild points - @gp (@maxgp)
70 (723) quest points - @qp (@maxqp)
213 (213) social points. - @sp (@maxsp)
Your current experience is 36447 - is @cxp
you are level 157 - @level
You have died 9 times and can die 2 times before you are completely dead. - You have died @death times and can die (this number plus @death) times before you are completely dead.

You are burdened (60%) - You are burdened (@burd%)


I've tried everything I could think of to get those to the varables but I screw up like every time. Any help will be gladly accepted.


Thanks in advance.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Apr 13, 2003 8:47 pm   
 
The easiest method to make triggers like these (IMO) is to paste the actual line into the trigger's Pattern section, then replace the numbers and anything else that might change with the appropriate wildcards, putting parentheses around anything that will be used in the Value section, and adding ~'s in front of any special characters. Once the pattern is finished, put the needed commands into the trigger's Value section. I usually do this at the command line, but I'd follow the same procedure if I was using the editor.

Like so:
  1. Select line to be copied
    You have 1732 (1732) hit points, 280 (280) guild points, 70 (723) quest points and 213 (213) social points.

  2. Paste line into trigger pattern
    #TR {You have 1732 (1732) hit points, 280 (280) guild points, 70 (723) quest points and 213 (213) social points.}

  3. Replace numbers with wildcards, add parentheses and ~'s
    #TR {You have (%d)1732 ~((%d)1732~) hit points, (%d)280 ~((%d)280~) guild points, (%d)70 ~((%d)723~) quest points and (%d)213 ~((%d)213~) social points.}

  4. Add commands
    #TR {You have (%d) ~((%d)~) hit points, (%d) ~((%d)~) guild points, (%d) ~((%d)~) quest points and (%d) ~((%d)~) social points.} {#VAR hp %1;#VAR maxhp %2;#VAR gp %3;#VAR maxgp %4;#VAR qp %5;#VAR maxqp %6;#VAR sp %7;#VAR maxsp %8}


LightBulb
Advanced Member
Reply with quote
Wakka
Newbie


Joined: 09 Apr 2003
Posts: 7

PostPosted: Sun Apr 13, 2003 9:59 pm   
 
Thank you Lightbulb once again...
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