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
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Mon Nov 16, 2009 2:30 am   

Variable Counter?
 
I have a Variable Counter like this shooting to my status window before...

like:
#add chatcount 1

and it would add to the vaiable, but now I have it going to another window, and its acting funky

its not adding em up its just addings 11111111111 which is poping out my session log window,

#execwin PlagueStatus {#say C: @chatcount T: @tellcount S: @saycount}
Returns: C: 1111111111111111111111111 T: 11 S: 1111
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 16, 2009 4:42 am   
 
The variable is probably set as a string. Set it to autotype or a numeric type.
_________________
EDIT: I didn't like my old signature
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Mon Nov 16, 2009 5:01 am   
 
got it thanks matt
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Mon Nov 16, 2009 9:28 pm   
 
This Should Be REturning 3 into my variable output right?

<var name="tellcount" id="9">
<value>111</value>
<default>0</default>
</var>

still returning 111 instead of 3

it worked when sendign to status indow but I think Ive gotta do something else if Iam sending it to a session window
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 16, 2009 9:40 pm   
 
What's the trigger that's doing the change to the variable? #ADD is a math command, but if you are doing something else that uses the variable as a string-type (ie, string, stringlist, datarecord) then it will treat the variable as a string instead of a number.

Where you display the results won't matter for this, so something somewhere is doing a non-math operation on your variable.
_________________
EDIT: I didn't like my old signature
Reply with quote
daemoan.vermillious
Apprentice


Joined: 28 Feb 2009
Posts: 135
Location: Chico, Ca

PostPosted: Mon Nov 16, 2009 10:01 pm   
 
Trigger:
<trigger priority="70" id="7">
<pattern>^~|~)~&gt;chat~&lt;~(~| %1~: %2</pattern>
<value>#capture PlagueLog
#add chatcount 1</value>
</trigger>

Variable:
<var name="chatcount" id="8">
<value>11112</value>
<default>0</default>
</var>


I really dont see anything Iam doing different than before...
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Nov 16, 2009 10:18 pm   
 
Try going to a number format. Integer is good enough.

The only other wrong thing you're doing is the %1/%2 in the trigger pattern, but I don't see how that could be affecting the variable.
_________________
EDIT: I didn't like my old signature
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