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


Joined: 09 Aug 2001
Posts: 39
Location: USA

PostPosted: Thu Sep 19, 2002 5:23 am   

gold counter, help
 
i need help on making a gold counter that will show up an the on status bar. i need it to show how much i am carring on me, show how much i have in the bank and then add the two togeather...
the triggers are...
There were (%d) coins.
(%w) gives you (%d) gold coins.
You get a gold coin from the corpse of
this tells how much is on me useing the show command
Con: 16 ( 50) Height : 7 Gold : (%d) coins.

now for the band one...
depositing - You deposit (%d) coins.
withdrawing - you withdraw (%d) coins.
for how much is in bank when useng the show command
Int: 12 ( 20) Age : 48 years Bank : (%d) coins.
i think that is it for the bank.

i think that is all of them for the gold.

this is how i would like to show up on status bar
Bank: (amount in bank) On Hand: (amound on self) Total: (total)

V6.16
Reply with quote
Retrovirus
Wanderer


Joined: 13 Jul 2002
Posts: 51
Location: Malaysia

PostPosted: Thu Sep 19, 2002 8:23 am   
 
#tr There were (%d) coins.
#var current_coin %d
#tr (%w) gives you (%d) gold coins.
#math add @current_coin %d
#tr You get %d gold coins from the corpse of
#math add @current_coin %d

#tr Con: %1 Height: %2 Gold : (%d) coins.
#var current_coin %d

#tr You deposit (%d) coins.
#math add @current_coin -%d

#tr you withdraw (%d) coins.
#math add @current_coin %d

#tr Int: %1 Age %2 years Bank : (%d) coins.
#var bank_coin %d
#math total_coin @bank_coin+@current_coin

@bank_coin = coins in bank
@current_coin = coins in hand
@total_coin = total coins


Cameth
Saweth
Fledeth my asseth offeth
Reply with quote
Raksasas
Novice


Joined: 09 Aug 2001
Posts: 39
Location: USA

PostPosted: Thu Sep 19, 2002 5:03 pm   
 
the total amount does not coming out right in

#tr Int: %1 Age %2 years Bank : (%d) coins.
#var bank_coin %d
#math total_coin @bank_coin+@current_coin

so i changed the math part to

#math total_coin {@bank_coin + @current_coin}

and it seem to work.... i have not tryed the...

#tr There were (%d) coins.
#var current_coin %d
#tr (%w) gives you (%d) gold coins.
#math add @current_coin %d
#tr You get a gold coin from the corpse of
#math add @current_coin 1

but it does not look like they add to the total when i kill the mobs but i will check it and find out
V6.16
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Sep 19, 2002 5:59 pm   
 
Nothing hard here. When you get gold, add it to the current amount; when you spend it or give it away, subtract it. When you deposit gold, add it to the amount in the bank and subtract it from the amount on hand; when you withdraw gold, subtract it from the bank balance and add it to the amount on hand. Since you might not have triggers for everything that can change the amounts, the show command gives you an easy way to correct the amounts from time to time.
#TR {There were (%d) coins} {#ADD current_coin %1}
#TR {(%w) gives you (%d) coins} {#ADD current_coin %2}
#TR {You get (%d) gold coins from the corpse} {#ADD current_coin %1}
#TR (You get a gold coin from the corpse} {#ADD current_coin 1}
#TR {You give (%d) gold coins to} {#ADD current_coin -%1}
#TR {You buy * for (%d) gold coins} {#ADD current_coin -%1}
#TR {You deposit (%d) coins} {#ADD bank_coin %1;#ADD current_coin -%1}
#TR {You withdraw (%d) coins} {#ADD bank_coin -%1;#ADD current_coin %1}
#TR {Con: %d ~( %d~) Height : %d Gold : (%d) coins.} {#VAR current_coin %1}
#TR {Int: %d ~( %d~) Age : %d years Bank : (%d) coins.} {#VAR bank_coin %1}
#ST {Bank: @bank_coin On Hand: @current_coin Total: %eval(@bank_coin + @current_coin)}


LightBulb
Senior Member
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