|
Hamaro Newbie
Joined: 16 Jan 2005 Posts: 6 Location: Germany
|
Posted: 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 ¤t gold from the corpse.
Thanks |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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. |
|
|
|
Falan Wanderer
Joined: 17 Aug 2004 Posts: 98 Location: OK, USA
|
Posted: Sun Jan 16, 2005 6:05 am |
#TR {You get ¤t 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 |
|
|
|
|
|