Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
geniusclown
Magician


Joined: 23 Apr 2003
Posts: 358
Location: USA

PostPosted: Sat Jun 18, 2011 4:19 pm   

"ERROR: Operator unrecognized function requires two arguments"
 
I recently started MUD'ing again after many years of avoidance... I have zMUD registered from back then, but since I'm essentially starting from scratch, I've downloaded cMUD and started playing with it. I'm very frustrated with how often it crashes for reasons that make no sense - usually giving an error about a function that I haven't used in any of my scripts (such as concat - I know what it does, but haven't had a need for it yet). What follows is how I produce such an error, although I'm getting many others from different scripts.

In my previous session, I disabled all scripts except for one. The purpose of this script is to harness the game's "roundtime" mechanic, in which many actions have to wait for a specified period of time before executing the next one. For example, if I swing my sword and get a 4 second roundtime, I can't swing it again for 4 seconds.

Here is the complete class. All other classes and setting have been disabled.

<class name="Roundtime" id="141">
<var name="rt" id="7">3</var>
<button name="rtGauge" type="Gauge" variable="@rt" autosize="false" width="100" height="15" toolbar="2" color="red" gaugelowcol="None" gaugebackcol="#E0DFE3" priority="160" id="8">
<caption>RT: @rt</caption>
<value>#T+ rtdetect
rt=.1</value>
<expr>@rt*10</expr>
<gaugemax>@rtm*10</gaugemax>
</button>
<var name="rtm" id="9">6</var>
<trigger priority="1120" id="112">
<pattern>...wait (%n) sec</pattern>
<value>rt=%1</value>
</trigger>
<trigger name="rtdetect" type="Expression" priority="1420" newline="false" id="142">
<pattern>@rt>0</pattern>
<value>#T- rtdetect
#SET rtcount</value>
</trigger>
<trigger name="rtcount" type="Manual" param="1000" priority="1430" id="143">
<value>#WAIT 100
rt=%eval(%float(%round(@rt*10))/10)-.1
#sh @rt
#IF (@rt>0) {#SET rtcount} {#T+ rtdetect}</value>
</trigger>
<trigger priority="1440" id="144">
<pattern>Roundtime: (%n) sec</pattern>
<value>rt=%1
rtm=%1</value>
</trigger>
</class>

First, I "Open Session Offline", and turn on the Script Debugging Log. Next, I type into the command line "#VAR rt 5" to mock a 5 second roundtime. The gauge counts from 5 down to 3 (instead of down to zero), ticking off 1/10 second increments... the "#SH @rt" line was input for this debugging, so I also have a display in the main window, followed by "ERROR: Operator unrecognized function requires two arguments". Here is the Script Debugging Log output for the entire session up to the error:
| f Dragonre | Expression: @rt>0
0.0012 | c Dragonre | [1] ExpTrig : start : Expression "rtdetect" : #T- rtdetect #SET rtcount
0.0017 | f Dragonre | Manual:
0.0005 | c Dragonre | [1] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0002 | d Dragonre | [1] ExpTrig : wait 9501 ms
0.0050 | a Dragonre |0
0.0967 | d Dragonre | [1] ExpTrig : terminated
9.6707 | ---
0.0006 | c Dragonre | [2] Dragonrealms Comline : start :
0.0007 | f Dragonre | Expression: @rt>0
0.0007 | c Dragonre | [3] ExpTrig : start : Expression "rtdetect" : #T- rtdetect #SET rtcount
0.0007 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0002 | d Dragonre | [3] ExpTrig : wait 9497 ms
0.0002 | d Dragonre | [2] Dragonrealms Comline : stopped
0.1014 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.9
0.0047 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0977 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.8
0.0045 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0979 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.7
0.0043 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0982 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.6
0.0044 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.1003 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.5
0.0044 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0976 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4.4
0.0043 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0982 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |4.3
0.0044 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0983 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |4.2
0.0042 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0975 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |4.1
0.0042 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0976 | e Dragonre | [3] ExpTrig : resumed
0.0033 | a Dragonre |4
0.0044 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0981 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.9
0.0043 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0975 | e Dragonre | [3] ExpTrig : resumed
0.0032 | a Dragonre |3.8
0.0045 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0970 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.7
0.0042 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0976 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.6
0.0041 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0977 | e Dragonre | [3] ExpTrig : resumed
0.0038 | a Dragonre |3.5
0.0042 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0978 | e Dragonre | [3] ExpTrig : resumed
0.0032 | a Dragonre |3.4
0.0041 | f Dragonre | Manual:
0.0009 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0971 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.3
0.0042 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0975 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.2
0.0041 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0977 | e Dragonre | [3] ExpTrig : resumed
0.0031 | a Dragonre |3.1
0.0041 | f Dragonre | Manual:
0.0004 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0976 | e Dragonre | [3] ExpTrig : resumed
0.0032 | a Dragonre |3
0.0018 | f Dragonre | Manual:
0.0005 | c Dragonre | [3] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0001 | a Dragonre |ERROR: Operator unrecognized function requires two arguments
0.0088 | d Dragonre | [3] ExpTrig : terminated
0.0000 |

I'm certain that there's a question or five about the "rt=%eval(%float(%round(@rt*10))/10)-.1" business. This is my workaround for the inaccuracy of calculating floating points. If I trim that line down to the obvious "rt=@rt-.1" or "#ADD rt -.1", I get output such as:
1
0.900000000000001
0.800000000000001
0.700000000000001
0.600000000000001
0.500000000000001
0.400000000000001
0.300000000000001
0.200000000000001
0.100000000000001
1.02695629777827E-15

I ran the script several times in a row, and got the last second like this several times in a row before cMUD completely locked up and Windows gave me a "not responding" message.

After restarting the program, I repeated the experiment. I got different errors such as (copied from the debugging log):
0.0004 | c Dragonre | [5] Dragonrealms Trigger : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0983 | e Dragonre | [5] Dragonrealms Trigger : resumed
0.0032 | a Dragonre |0.8
0.0049 | a Dragonre |RT:
0.0021 | j Dragonre >RT:
0.0024 | a Dragonre |ERROR: argument still on stack: @
0.0665 | a Dragonre |@
0.0025 | j Dragonre >@
0.0032 | d Dragonre | [5] Dragonrealms Trigger : terminated
0.0000 |

...and this one (which didn't abort the script, but gave some strange output, displaying a countdown of 2.7,28,2.6...)...
0.0001 |
0.0014 | f Dragonre | Manual:
0.0005 | c Dragonre | [5] Dragonrealms Trigger : start : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0014 | d Dragonre | [5] Dragonrealms Trigger : wait 9518 ms
0.0974 | e Dragonre | [4] Dragonrealms Trigger : resumed
0.0032 | a Dragonre |28
0.0016 | j Dragonre >28
0.0001 | e Dragonre | [5] Dragonrealms Trigger : resumed
0.0034 | a Dragonre |2.6
0.0045 | f Dragonre | Manual:
0.0004 | c Dragonre | [5] Dragonrealms Trigger : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...

...and this one...
0.0055 | f Dragonre | Manual:
0.0003 | c Dragonre | [7] ExpTrig : exec : Manual "rtcount" : #WAIT 100 rt=%eval(%float(%round(@rt*1...
0.0981 | e Dragonre | [7] ExpTrig : resumed
0.0031 | a Dragonre |3.8
0.0050 | a Dragonre |ERROR: argument still on stack:
0.0065 | a Dragonre |
0.0014 | j Dragonre >
0.0003 | a Dragonre |
0.0014 | j Dragonre >
0.0032 | d Dragonre | [7] ExpTrig : terminated
0.0000 |

I am running cMUD version 3.34 with Windows XP Tablet PC Edition 2005 SP3, on a 1.6 GHz Intel Core2 Duo laptop. (guess why I'm MUD'ing instead of playing Blizzard games)

I would like to continue using cMUD, but these types of apparently random errors makes it nearly impossible. With all my scripts running, the program typically crashes after 15 to 45 minutes of play, often within minutes. I have taken the habit of closing the Package Editor and switching to other programs and back to help keep stability (otherwise, the Package Editor stops updating and a crash is inevitable at that point). I hope this is indicative of some currupt dll that can be fixed or something. I've already copied the XML, deleted the .pak file, and restored via XML. This did no good.

Thanks for reading through my rambles,
.geniusclown
_________________
.geniusclown
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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