Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Variables

Variables

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Computer_crasher   (2 posts)  Bio
Date Sat 11 Feb 2006 04:09 PM (UTC)
Message
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.
Top

Posted by Essidus   (16 posts)  Bio
Date Reply #1 on Sat 11 Feb 2006 05:43 PM (UTC)
Message
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.
Top

Posted by Computer_crasher   (2 posts)  Bio
Date Reply #2 on Sat 11 Feb 2006 10:11 PM (UTC)
Message
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 :(
Top

Posted by Essidus   (16 posts)  Bio
Date Reply #3 on Sat 11 Feb 2006 10:31 PM (UTC)
Message
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.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


12,365 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.