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


Joined: 05 Mar 2007
Posts: 33
Location: Paulsboro,NJ

PostPosted: Tue Mar 20, 2007 6:00 am   

Need help with a gold/xp counter
 
What I am looking for is a counter for gold and exp during runs,also to count how many mobs were killed and give a kill per tick average.

My mud reads like this when a mob is slayed:

You receive your reward for the kill, 127172 experience points.
Your blood freezes as you hear Nick the kruegerman's death cry.
<player> gets a small mountain of gold coins from the corpse of Nick the
kruegerman.
<player> splits x gold coins, and you receive x.

How would I make a counter?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Mar 20, 2007 6:07 am   
 
Pretty simple really.

#var XPCount 0
#var GoldCount 0

#alias ResetSession {#var XPCount 0;#var GoldCount 0}
#trig {You receive your reward for the kill, (%d) experience points.} {#add XPCount %1}
#trig {(%w) splits %d gold coins, and you receive (%d).} {#add GoldCount %2}
Reply with quote
shakey
Novice


Joined: 07 Jul 2007
Posts: 40

PostPosted: Fri Jul 13, 2007 8:34 am   
 
And how would you send this info into a status window?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Jul 13, 2007 10:22 am   
 
@XPCount will represent the XP count - @GoldCount will represent the gold count. Use them on the status line or window, in #echo commands, wherever you want.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
shakey
Novice


Joined: 07 Jul 2007
Posts: 40

PostPosted: Fri Jul 13, 2007 1:50 pm   
 
Ok I get that, if I use the #show or #echo command as the first word when I type it into my mud, it works. But I can't get it to work any other way. Let alone have the variables work in a gorup tell or something
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Jul 13, 2007 9:08 pm   
 
It's quite easy to get it to report in a group tell or something. You can try the following:

#alias report {#IF %0 {} {%1 I have gained @XPCount experience and @GoldCount gold since last reset.}}

Then all you need to do is type 'report gtell' and it'll automatically report your stats on group tell. You can also do 'report say' and it'll say your stats. This is untested for now (I don't have zMUD in front of me at the moment), but it should work without a problem. I use this format quite a bit in a lot of my scripts. Let me know how it turns out for you. :)

Charneus
Reply with quote
shakey
Novice


Joined: 07 Jul 2007
Posts: 40

PostPosted: Sat Jul 14, 2007 5:15 am   
 
I've figured out how to make it print to screen.. But now I want to make it display on a button. Is there anyway to do that? Or to have a seperate status window like this guy?


http://members.fortunecity.com/alteraeon/screenshot.htm
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Jul 14, 2007 7:09 pm   
 
That's quite easy, too. I have it set up where my exp/gold show on push buttons.

Easiest way to do that is through the Settings->New Button setup. You can mess around with the colors and everything you want, but the most important thing is wherever it says "variable," place the correct variable there. I don't have zMUD set up in front me again, but once I do, I'll post more concise instructions. Hopefully you'll be able to figure it out, though. It's pretty self-explanatory. :)

Charneus
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