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


Joined: 19 Sep 2005
Posts: 3

PostPosted: 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?
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: 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.
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
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