quick question

Posted by Metsuro on Sat 08 May 2004 10:57 PM — 8 posts, 27,444 views.

USA #0
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
Russia #1
you could easily do that
USA #2
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?
Russia #3
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.
USA #4
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
Australia Forum Administrator #5
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
USA #6
say you have a trigger to change colour of the person transferring you the credits, would that affect the trigger?
Australia Forum Administrator #7
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.