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


Joined: 16 Jan 2005
Posts: 6
Location: Germany

PostPosted: Sun Jan 16, 2005 3:15 am   

Variables
 
I tried working this out but I can't get it. Sorry if its very beginner's stuff....

I created 2 integer variables. (I think this is right)
#var original {} {123343546}
#var current {0} {_nodef}

I also need a variable that will hold the value of "Current" - "Original" multiplied by 300.
#var total {(@current - @original) x 300} {_nodef}

Also, I tried to use the variable and it isn't working. Like i type say @total, and "You say '@total'" appears...not the value..

Capturing the "current" variable should be set up like this right?
You get &current gold from the corpse.



Thanks
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jan 16, 2005 5:58 am   
 
zMUD uses 32-bit integers, which makes 2,147,483,647 the largest integer recognized. As you can see, this is less than 20 times your original value of 123,343,546 so multiplying by 300 is likely to produce numbers which are larger than zMUD can use. Instead of multiplying, you should be dividing your numbers. When you're dealing with millions and billions, ones and even thousands don't usually matter much.
_________________
LightBulb
Senior member

Most scripts in this forum are written for Command Line entry.
Don't even open the Settings Editor unless its use is specified or obvious.
Reply with quote
Falan
Wanderer


Joined: 17 Aug 2004
Posts: 98
Location: OK, USA

PostPosted: Sun Jan 16, 2005 6:05 am   
 
#TR {You get &current gold from the corpse.} {#MATH total (@current-@original)*300}

See #VARIABLE: "To specify no default, leave this parameter out or use the _nodef value."

Are you wanting to #SAY your total to yourself, or say your total to your MUD?

#SAY @total //will display the current value of total without sending it to the MUD (as will #SHOW and #ECHO).
_________________
zMUD 7.05a
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