Trigger / Wildcard assistance please.

Post Reply
NMadison
Posts: 4
Joined: Sat Jan 26, 2013 10:36 pm

Trigger / Wildcard assistance please.

Post by NMadison »

I've looked through the Forum and the manual and tried several variations (below) to get, what I'm sure, is a simple trigger to work correctly and yet I can't seem to manage it.

What I'm trying to accomplish:
1) I'm enchanting a piece of EQ
2) Occasionally the enchant will fail removing all attributes from an item generating this phrase:

"(a|an|the) <name of item> glows brightly, then fades...oops."

3) I want to automatically drop and then ash the item.

Issues: items have anywhere from one to quite a few words in their titles and, as you can see, sometimes begin with "a" , "an" or "the". For example:

"an ironwood mace glows brightly, then fades...oops."

And even worse

"a pair of rabbit-lined gloves glows brightly, then fades...oops."

I have tried several variations of:

(a|an|the) (.*) glows brightly, then fades...oops.
send("drop" .. matches[2])
send("ash" .. matches[2])

But I'm not doing something right. What am I missing here?

Delrayne
Posts: 159
Joined: Tue Jun 07, 2011 7:07 pm
Contact:

Re: Trigger / Wildcard assistance please.

Post by Delrayne »

The trick here is finding the keyword used for each item. I would suggest something along the lines of this:
Code: [show] | [select all] lua
--Trigger:
^(.+) glows brightly, then fades\.\.\.oops\.$

code:
if (string.find(matches[2], "mace")) then
  send("drop mace")
  send("ash mace")
elseif (string.find(matches[2] "sword")) then
  send("drop sword")
  send("ash sword")
end
That's just how I would do it, someone else might have a better way.

NMadison
Posts: 4
Joined: Sat Jan 26, 2013 10:36 pm

Re: Trigger / Wildcard assistance please.

Post by NMadison »

I got it to work, thanks. I had to do a little tinkering, but my main problem was I was using "substring" rather than "perl regex".... Step 1) is your computer plugged in sir? face\palm

Post Reply