|
Alexiel Novice
Joined: 05 Mar 2007 Posts: 33 Location: Paulsboro,NJ
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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} |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: Fri Jul 13, 2007 8:34 am |
And how would you send this info into a status window?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
Posted: 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
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
shakey Novice
Joined: 07 Jul 2007 Posts: 40
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
|
|