Trigger help, text matching and variable setting

Posted by TheExile on Thu 15 Sep 2011 02:49 PM — 3 posts, 15,521 views.

#0
I thought I would make a simple trigger to capture a mobs name as they attacked me, set it as a variable and use an alias to "kill target" to make killing same named mobs a bit faster.

Well it didn't turn out to be so simple, the problem I run into is matching the text because mobs names can be one word or five and their attack (which can be almost as varied) comes before the you, an example.

Quote:
Large Metallic Drone thrashes you in the ribs


This mob uses thrashes as his attack but there are mobs that shoots/slashes/bludgeons/etc. also with this mobs as with all of them there is usually a couple shortcuts you can use to kill it, in this mobs case, "kill drone/large/metallic" all work.

I'm just unsure of what to do here, if someone can help me out with capturing the mob's name and setting it to a variable, if I have to I can insert all the possible attacks into the trigger (shoots|slashes|bludgeons|etc).

Thanks for any and all assistance.
Amended on Thu 15 Sep 2011 02:50 PM by TheExile
Australia Forum Administrator #1
The general technique would be to match something like this (using regular expressions):



^(.*) (shoots|slashes|bludgeons|etc) you 


Now %1 is the mob name.
#2
Ah yes, thank you, with that I finally got it working. I didn't think (.*) matched multiple words that was on me for not trying that.

Thanks for the help.