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


Joined: 17 Mar 2004
Posts: 4
Location: Canada

PostPosted: Sat Sep 16, 2006 5:45 pm   

Exp Tracking & Buttons
 
Howdy,

I was wondering if I could get a little assistance please.

I am currently trying to create a button that autotracks my experience, and changes color when it maxes out.

Currently using zMUD v7.04

The lines of intrest are:

Capture line from a kill:

You receive your share of experience -- 1358 points.

Minimum Exp - 0
Maximum Exp - (shown in score as: 2,040,000,000) (shown everywhere else as) 2040000000

Basically every 2.04 billion experience, I must spend my experience in order to continue leveling. I simply was trying to create some sort of gauge to keep me informed so I didn't have to keep typing out score as I was fighting.

Also is it possible for it to change color as it raises? something like:

0 - Experience (Grey)
500,000,000 - Exp (Green)
1,000,000,000 - Exp (Cyan
1,500,000,000 - Exp (Blue)
2,040,000,000 - MAX (Red)

Thanks in advance,

Magister.
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Sat Sep 16, 2006 6:37 pm   
 
Something like this might work :-). Obviously a trigger/alias to reset the currentExp variable back to 0 after levelling might be needed.

#CLASS {expbutton}
#VAR currentExp {0}
#VAR buttonColor {gray}
#TRIGGER {You receive your share of experience -- (%d) points.} {
currentExp = %mss( @currentExp+%1)
buttonColor = "red"
#if (%mss( @currentExp < 2040000000) = -1) {buttonColor=%eval( %color( hi)+%color( blue))}
#if (%mss( @currentExp < 1500000000) = -1) {buttonColor="cyan"}
#if (%mss( @currentExp < 1000000000) = -1) {buttonColor="green"}
#if (%mss( @currentExp < 500000000) = -1) {buttonColor="gray"}
#noop %btncol( xpbutton, brown, @buttonColor)
}
#BUTTON 1 {%mss(FormatNumber(@currentExp, 0)) Exp} {} {} {} {} {} {} {Size} {100} {23} {} {} {} {103} {} {} {} "" {} {} {xpbutton}
#CLASS 0
Reply with quote
Magister_Artimis
Newbie


Joined: 17 Mar 2004
Posts: 4
Location: Canada

PostPosted: Sat Sep 16, 2006 7:04 pm   
 
Thanks for the reply Rorso.

Sorry to be a pain in the ass, but could you walk me through this step by step because I tried to create everything, and it's not working...

Ie:

Click Class, click new, name =
Click Variable, click new, name = , default = , value =
Click Trigger, click new, pattern = , value =
Click Button, click new, kind = , caption = , value = ,

(Currently I have the button set to gauge, but it has 3 headers: Value, Gauge Max, Gauge Low .. what goes in value? Gauge max and low I figure is just the 0 and 2.04 numbers.)

Also if a trigger to reset the currentExp variable back to 0 is needed, what would that look like?

Thanks again.

P.s. I am also getting the following error message:

Scriptting language 0)) exp} {} {} {} {} {} {} {size} {100} {23} {} {} {} {103} {} {} {} "" {} {} {xpbutton} not supported

followed by:

error evaluating: format number (@currentexp) invalid character (error 1032) on line 1, colum 14
Reply with quote
Rorso
Wizard


Joined: 14 Oct 2000
Posts: 1368

PostPosted: Sat Sep 16, 2006 7:27 pm   
 
Try doing this:
1. Create a new class folder named "expbutton".
2. Copy the script in my post excluding the #class lines
3. In zMUD select the <none> class and then click the "expbutton" class in the rightmost list.
4. Select "Class Script"
5. Paste between the "#class .... #class" commands and click the 'Save' button.
Reply with quote
Magister_Artimis
Newbie


Joined: 17 Mar 2004
Posts: 4
Location: Canada

PostPosted: Sat Sep 16, 2006 7:46 pm   
 
Ok thanks, will do :)
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