Variables

Posted by Computer_crasher on Sat 11 Feb 2006 04:09 PM — 4 posts, 16,072 views.

#0
I would like to write something that basically recorded how many of something I've done, and then put it in the output as some sort of note.

For example, theres something in Achaea that has about 10 identical messages that I'd like to count as they are seen:

Quote:
The air about you shimmers as your magic continues to carve its way through the unseen dimensions.


... and with each of these I'd like to send "Splice X" each time its seen.

What I need to do is have a variable, and then each time a trigger fires add a value to that variable and update the variable. Basically, it counts 1, 2, 3 etc.
#1
A counting script is fairly simple. You've already mentioned the things you really need. All you have to do is give the variable (called count, for simplicity) an initial value of 0, and then set your display message. It should end up looking similar to this:
setvariable "count", @count + 1
note "Splice @count"

Just remember, you need to make sure that in your trigger, you've got expand variables checked, or else it will read @count as a string.
#2
Thanks. I tend to know what I want to do, and how I'd do it, I just don't know the language to do it :(
#3
I know that feeling. I'd suggest spending some time getting aquainted with the common functions and scripts in your language of choice. Not in mushclient, but simply in general. I have a book on vbscript I refer to regularly when I'm programming.