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 ➜ General ➜ I need help with triggers!

I need help with triggers!

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


Posted by Zevren   (1 post)  Bio
Date Sat 23 Jun 2018 01:10 AM (UTC)
Message
I need to make a trigger to assess the amount of herbs there are, and pick as many as I can, while leaving 20 there. Each herb I pick requires me to regain balance before entering PICK <herb> again.
For example, I type HERBS (to see how many are in my location) I get this:
You forage around for wild herbs.
There are thirty-eight batches of siriena here.

I want to pick 18 Siriena, since that would leave 20 unpicked.

How would I do this????
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 23 Jun 2018 03:07 AM (UTC)
Message
See the "wait" module as mentioned here:

http://www.gammon.com.au/modules




Also see:

http://www.gammon.com.au/forum/?id=10155

There is a module that comes with MUSHclient that converts word to numbers, eg.


require "words_to_numbers"

number = convert_words_to_numbers ("thirty-eight")

print (number)  --> 38

- Nick Gammon

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

Posted by Violetkeen   (1 post)  Bio
Date Reply #2 on Tue 07 Aug 2018 09:39 AM (UTC)
Message
This case only shows how Gammon works for good! Awesome!
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.


11,382 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.