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 ➜ Lua ➜ Getting better, but not there yet

Getting better, but not there yet

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


Posted by Siris   (17 posts)  Bio
Date Wed 01 Sep 2010 10:03 PM (UTC)
Message
<triggers>
<trigger
enabled="y"
keep_evaluating="y"
match="^This quest is called \'(?P&lt;quest_name&gt;.+)\'\, for Adventurers levels (?P&lt;quest_min_lvl&gt;.+) to (?P&lt;quest_max_lvl&gt;.+)\.$"
regexp="y"
send_to="10"
sequence="100"
>
<send>world.SetClipboard ("Quest Name %1")
world.note ("Quest Name %1")</send>
</trigger>
</triggers>
i've tried with and without world. before the commands, and the trigger is set to execute.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Wed 01 Sep 2010 10:14 PM (UTC)
Message
1. it's helpful to say what exactly is not working, i.e. are you getting an error message.

2. Check the documentation for 'note':

Template:function=AddTrigger AddTrigger

The documentation for the AddTrigger script function is available online. It is also in the MUSHclient help file.


David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Siris   (17 posts)  Bio
Date Reply #2 on Wed 01 Sep 2010 10:20 PM (UTC)
Message
In a nut shell, I want it to copy the quest name into the clipboard. I've written a small program using autohotkey to wait for clipboard changes, and reference the quest name against a database I have. Essentially bringing up a walk through for the quest. But when the trigger fires it just sends the command to the mud instead of parsing them. Sorry for the vagueness.
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #3 on Thu 02 Sep 2010 12:48 AM (UTC)
Message
You want "send to script" not "execute".

Execute just sends what you have back to be re-evaluated as an alias (so it ends up going to the world).

You can get rid of the world. prefix.

Note starts with a capital N. So a more likely-to-work version is:


<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^This quest is called \'(?P&lt;quest_name&gt;.+)\'\, for Adventurers levels (?P&lt;quest_min_lvl&gt;.+) to (?P&lt;quest_max_lvl&gt;.+)\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>
SetClipboard ("Quest Name %1")
Note ("Quest Name %1")
</send>
  </trigger>
</triggers>


- Nick Gammon

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

Posted by Siris   (17 posts)  Bio
Date Reply #4 on Fri 03 Sep 2010 12:27 AM (UTC)
Message
Just an update, this is what I finished with, I'm pretty happy with the outcome. Mainly because it works, however I believe I could 'DRY' it up some with further knowledge.

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="^This quest is called \'(.*?)\'\, for Adventurers levels (.*?) to (.*?)\.$"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>Hyperlink ("browseto http://www.clanannwn.net/quest/search/?search=quest&amp;keyword=%1&amp;sort=questname", "Open Walkthough for the Quest Named '%1'","Opens a Link for the walkthough for the quest '%1'", "blue", "Lime", 0)
</send>
  </trigger>
</triggers>

And then the alias to run OpenBrowser, because I could not get it to launch via hyperlink

<aliases>
  <alias
   match="browseto *"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>OpenBrowser "%1"</send>
  </alias>
</aliases>


I'm very satisfied with it, anyone have any suggestions?
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.


18,848 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.