Getting better, but not there yet

Posted by Siris on Wed 01 Sep 2010 10:03 PM — 5 posts, 24,753 views.

#0
<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.
USA #1
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.

#2
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.
Australia Forum Administrator #3
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>

#4
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?