|
SolarianKnight Newbie
Joined: 19 Sep 2005 Posts: 3
|
Posted: Mon Sep 19, 2005 11:50 pm
Bizarre #MATH problem |
The StormFront interface for DragonRealms forecasts the amount of time it will take to perform an action and sends it to the client in the form of a UNIX-like timestamp. Everytime the MUD sends the prompt, it sends the present gameworld time with it. I have triggers set to retrieve and store the time and roundtime prediction.
Variable Values
@roundtime_rawmax = 1127176752
@prompt_time = 1127176749
Code Fired on Trigger
#MATH roundtime_maximum (@roundtime_rawmax-@prompt_time)
This should produce 3 in the roundtime_maximum variable right? Wrong. roundtime_maximum becomes 134! What's so bizarre about this is that when the same #MATH command is executed from the command-line, it properly stores 3 in roundtime_maximum.
I'm absolutely perplexed. The timestamp is smaller than the 32-bit limit for integers... Is there something wrong with my code, or is something wrong with the #MATH command? |
|
|
|
Slaem Apprentice
Joined: 20 Sep 2005 Posts: 135
|
Posted: Tue Sep 20, 2005 4:03 am |
Quote: |
@roundtime_rawmax = 1127176752
@prompt_time = 1127176749 |
Is the @ in the variable name causing the problem? You shouldn't use an @ in the variable name unless you plan to create an indirect reference. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Tue Sep 20, 2005 9:00 am |
For some reason I never really liked the #MATH command. Try using %eval
roundtime_maximum=%eval(@roundtime_rawmax-@prompt_time) |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|