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 ➜ quick question

quick question

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


Posted by Metsuro   USA  (389 posts)  Bio
Date Sat 08 May 2004 10:57 PM (UTC)
Message
Hmm i was wondering if you could get a trigger and get it to do math functions and then send the answer back to the game, so you would say what the answer was

Everything turns around in the end
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #1 on Sun 09 May 2004 05:15 AM (UTC)
Message
you could easily do that
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #2 on Sun 09 May 2004 05:36 AM (UTC)
Message
well say the trigger was to match on like

so and so says,"i have 50 cows, and i gave you 30, divide by 2." (numbers are different so)

and i needed to do the math, how would i set that up?

Everything turns around in the end
Top

Posted by Ked   Russia  (524 posts)  Bio
Date Reply #3 on Sun 09 May 2004 06:34 AM (UTC)
Message
For that exact say ("i have 50 cows, and i gave you 30, divide by 2.") you'd need the following trigger, granted that you need to divide the remainder of subtracting 20 from 50 by 2 (50-20)/2:

match = "i have * cows, and i gave you *, divide by *."
send = "world.note cstr((%1 - %2)/%3)
send to = Scripting

you need to have scripting enabled and vbscript as your scripting language for that to work.
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #4 on Mon 10 May 2004 06:23 AM (UTC)
Message
ok another question with math functions!

so and so transferrers * credits to you. (trigger)

what i want it to do is add the * to a variable so say its 10 and the variable was 1, to change it to 11

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #5 on Mon 10 May 2004 06:38 AM (UTC)
Message
You need to convert the variable to an integer.

Thus you might do this:

Match: * transfers * credits to you.
Send: SetVariable "credits", CInt (GetVariable ("credits")) + %2
Send to: script

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Metsuro   USA  (389 posts)  Bio
Date Reply #6 on Mon 10 May 2004 07:09 AM (UTC)
Message
say you have a trigger to change colour of the person transferring you the credits, would that affect the trigger?

Everything turns around in the end
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #7 on Mon 10 May 2004 07:17 AM (UTC)
Message
Yes, probably I would have it a lower sequence number (eg. 90), a regular expression, so it affects the name only, and check the "keep evaluating" box so that the other trigger also fires.

- 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.


19,262 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.