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
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Tue Nov 06, 2012 3:16 pm   

Counting..
 
what I want is simple enough. I want to just keep track of how many times I "Abolish" something.


You swiftly draw the ancient runes of abolishment around a
* and then alight them with a drop of blood and the
* vanishes.

it will always be the same message with "*" being whatever piece of equipment I'm abolishing.

I am new to zmud and guessing that its quite capable of doing this with some sort of trigger...

Any help is appreciated! thanks

//newbie
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Tue Nov 06, 2012 7:05 pm   
 
is this all on one line, or on three lines like your example would suggest?
_________________
Discord: Shalimarwildcat
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Wed Nov 07, 2012 5:50 am   
 
well it's one constant flowing message, it shows over 3 lines because of my word wrap

but as long as it can recognize "you swiftly draw" and just count how many times
that message is received
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Nov 07, 2012 5:58 am   
 
#TR {you swiftly draw} {drawCount=(@drawCount+1)}
_________________
Discord: Shalimarwildcat
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Wed Nov 07, 2012 7:36 am   
 
thanks, and is there a way to display the counter?
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Nov 07, 2012 2:37 pm   
 
How do you want to display it? As simple text in response to a command, like: showcount? As a graphical bar that increments as it grows? As a button that constantly displays the value? As part of your prompt? As part of the display in your status bar or status window? All are possible.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Wed Nov 07, 2012 2:50 pm   
 
a button that constantly displays value would best :) but any of those would be fine :)
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Wed Nov 07, 2012 4:28 pm   
 
make a button with a caption of:

Abolished: @drawCount

the rest of it can be left empty
_________________
Discord: Shalimarwildcat
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Thu Nov 08, 2012 7:25 am   
 
my drawCount variable isnt a number, its value shows up as :
((((+1)+1)+1)+1)
right now the button is there but it doesnt display a number
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Nov 08, 2012 2:00 pm   
 
Did you use the trigger Shalimar gave exactly? Including the parentheses? The parentheses are important for ensuring that you get mathematical addition instead of string concatenation.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4691
Location: Pensacola, FL, USA

PostPosted: Thu Nov 08, 2012 4:48 pm   
 
given that his other counting thread is in the zMUD folder instead.. try this

drawCount=%eval(@drawCount+1)

you might need to ensure it has an proper value to build off of by entering the following at the commnad line

drawCount=0
_________________
Discord: Shalimarwildcat
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Nov 08, 2012 7:31 pm   
 
Oh, yeah, if its Zmud instead of Cmud, that would do it.
Reply with quote
MyMiasma
Wanderer


Joined: 26 Oct 2012
Posts: 56

PostPosted: Fri Nov 09, 2012 12:13 pm   
 
Wow, it worked :) thanks guys!!!

Never learned to leave well enough alone.. the number seems to reset in new sessions, is there way to keep it always counting and continue the same count even if I
have to restart my computer or something?
_________________
It is better to die on your feet than to live on your knees.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Nov 09, 2012 12:19 pm   
 
Variables only reset like that when it has the use default value option checked.
_________________
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