|
How to capture 1 line of several almost identical and manipulate
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Smokebomb
(6 posts) bio
|
| Date |
Thu 29 Mar 2012 01:17 PM (UTC) [ quote
] |
| Message |
Hi there! I'm new to Lua and coding in general but have got a small grip on the basics such as variables, strings, functions and operators.
My question is how do I capture parts of 1 line of several similar lines and then manipulate that data with an alias.
Firstly, the line I wish to capture parts of is something like:
You still have to kill * a whittling boy (Child's Play)
Secondly, I wish to capture the mob (a whittling boy) and area of the mob (Child's Play).
Can I use wildcard's or do I need something else? I tried using wildcard's with no luck as a trigger to match the first line of several:
You still have to kill * a whittling boy (Child's Play)
You still have to kill * some sawgrass (The Fire Swamp)
You still have to kill * A Dragon Citizen (The First Ascent)
You still have to kill * A Gargoyle (The First Ascent)
You still have to kill * a bobwhite quail (The Forest of Li'Dnesh)
You still have to kill * a dark brown waterthrush (The Forest of Li'Dnesh)
You still have to kill * the scorpion (The Gauntlet)
You still have to kill * a hidden thief (The Path of the Believer)
You still have to kill * a beer-drinking ratling (Tournament Camps)
I tried the following as the trigger:
You still have to kill * ^\* (*)
And the following as the send:
hold portal
enter
d
rt %2
where %1
Nothing whatsoever happens when i 'campaign check' and the list of mobs left to kill is displayed, not even an error.
I tried asking on the MUD and they said something about regex but that's over my head, I tried looking on Google 'regex Lua' only to get completely confused.
Many thanks in advance,
Smoke-bomb.
| top |
|
| Posted by |
Nick Gammon
Australia (18,770 posts) bio
Forum Administrator |
| Date |
Reply #2 on Thu 29 Mar 2012 08:37 PM (UTC) [ quote
] |
| Message |
|
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.
790 views.
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )