how can I....

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

how can I....

Post by Israafiyl »

How can I capture this:

You are wielding:
saber8701 : a dual-bladed saber of gold and silver in
your left hand.

(exactly as shown)

to match this:


weaponhand = matches[3]
if weaponhand == "left" then
weaponleft = matches[2]
elseif weaponhand == "right" then
weaponright = matches[2]
elseif weaponhand == "hands" then
weapon = matches[2]
end

Currently I have this as my trigger and it doesn't capture these double lines:

^.+?(\d+) : .+ in your (\w+) hand.$

deleteLineP()
weaponhand = matches[3]
if weaponhand == "left" then
weaponleft = matches[2]
elseif weaponhand == "right" then
weaponright = matches[2]
elseif weaponhand == "hands" then
weapon = matches[2]
end

with the firelength a 2

Any help would be great!

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: how can I....

Post by phasma »

Looks like an Iron Realms game to me which means you can just set the wrapping width to 0 which will remove the need to capture multiple lines.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: how can I....

Post by Israafiyl »

I tried that it doesn't work

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: how can I....

Post by phasma »

Try this pattern:

Code: Select all

^[A-Za-z]+(\d+) \: .+ in your (\w+) hand\.$

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: how can I....

Post by Israafiyl »

not seeming to work

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: how can I....

Post by phasma »

Pattern is fine, for sure. Gimme a few to wake up and I'll log onto my knight.

What game is this, anyway? You might actually have this data available via GMCP.

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: how can I....

Post by Israafiyl »

Midkemia Online

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: how can I....

Post by Israafiyl »

now available via GMCP it seems hmmmm

Israafiyl
Posts: 56
Joined: Mon Jul 16, 2012 12:29 am

Re: how can I....

Post by Israafiyl »

NOT available...sorry

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: how can I....

Post by phasma »

Meh. SIlly MKO bugs.

Try this pattern and let me know how you get on:

Code: Select all

^\s+?[A-Za-z]+(\d+) \: .+ in your (\w+) hand\.$
If you ever use a two-handed weapon, you'll want to change that to:

Code: Select all

^\s+?[A-Za-z]+(\d+) \: .+ in your (\w+?: )?hands?\.$

Post Reply