[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]  Lua
. . -> [Subject]  Getting better, but not there yet
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Getting better, but not there yet

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


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

Posted by David Haley   USA  (3,881 posts)  [Biography] 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
[Go to top] top

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

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

Posted by Siris   (17 posts)  [Biography] 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?
[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.


3,994 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]