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 ➜ Multiline info thing

Multiline info thing

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


Posted by Metsuro   USA  (389 posts)  Bio
Date Mon 13 Sep 2004 04:45 PM (UTC)
Message
Trying to get lines like

An almost complete robot's elbow nicks you! (1)
An almost complete robot's elbow nicks you! (6)
An almost complete robot's knee nicks you! (5)

to take the damage add them together and gag the attack and just send the damage at the end of it to lower spam. not quite sure how to even begin to start this

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,162 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 14 Sep 2004 12:57 AM (UTC)

Amended on Tue 14 Sep 2004 12:58 AM (UTC) by Nick Gammon

Message
First I would get the adding right. Something like this:


Match: A* nicks you! (*)
Send:

SetVariable "damage", CInt (GetVariable ("damage")) + %2

Send to: script
Omit from output: checked
Sequence: 90


That should add up the damage amounts into a variable called "damage",.

Now you need to detect when the list has ended.

Say, another trigger that matches everything, and shows the total, then clears it out:


Match: *
Send:

if CInt (GetVariable ("damage")) > 0 Then
  ColourNote "white", "red", "Total damage = " & GetVariable ("damage")
  SetVariable "damage", "0"
end if

Send to: script
Keep evaluating: checked
Sequence: 100


The first trigger with the lower sequence number will match the damage message, add it up, and omit the line.

The second trigger, which will only match if the first one doesn't, shows a non-zero total (since it then sets it to zero, you won't get the message repeatedly).

Then by using "keep evaluating" your other triggers will also match as usual.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


10,229 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.