[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  quick question
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

quick question

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


Posted by Metsuro   USA  (389 posts)  [Biography] 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
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Sun 09 May 2004 05:15 AM (UTC)
Message
you could easily do that
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] 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
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] 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.
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,610 posts)  [Biography] 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
[Go to top] top

Posted by Metsuro   USA  (389 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,610 posts)  [Biography] 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
[Go to top] 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.


4,116 views.

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

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]