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 ➜ Help with a hunting trigger.

Help with a hunting trigger.

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


Posted by Layston   (2 posts)  Bio
Date Sun 07 May 2006 09:22 PM (UTC)
Message
I haven't been able to figure this out yet, but in Aardwolf there's a skill that allows you to hunt for mobs, and this is how it works:

Send: Hunt dog
Receive: 'The monstruous dog is West from here.'

This is kinda how it looks like. What I did is to write a trigger will go to the direction specified by the line and and the hunt the dog, but it won't send 'dog' only, it would send 'monstruous dog' Wich the client wouldn't recognize.

Wouldn't it be possible that after the direction that is sent, it could repeat the mob name I sent?

Layston - Aardwolf
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 08 May 2006 10:49 AM (UTC)
Message
Well without actually sitting down and writing it, I would do something like this:


  1. Make an alias: hunt *

    This would remember what you are hunting and save it as a variable (dog in your case).

  2. Make a trigger: The * is * from here.

    When this matches you use the saved word (dog) rather than whatever matched the wildcard.

- Nick Gammon

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

Posted by Layston   (2 posts)  Bio
Date Reply #2 on Mon 08 May 2006 05:42 PM (UTC)
Message
I'm sorry, but I'm kinda new to Mush...

How can you save the name I putted in the Alias and send it to the trigger wich is going to do the next action and then use the variable I used to hunt to send the command again?

Sorry, I'm kinda confused here...
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 08 May 2006 10:23 PM (UTC)
Message
Here - this is using Lua:


<aliases>
  <alias
   match="hunt *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>
hunted = "%1"
Send ("%0")</send>
  </alias>
</aliases>


<triggers>
  <trigger
   enabled="y"
   match="The * is * from here."
   send_to="12"
   sequence="100"
  >
  <send>
Send ("%2")
Send ("hunt " .. hunted)</send>
  </trigger>
</triggers>



The alias saves what you are hunting in the (Lua) variable "hunted".

The trigger sends the direction (eg. West) and then sends "hunt " followed by whatever was in the hunted variable.

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


14,553 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.