filter trigger that has script action - possible?

Post Reply
Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

filter trigger that has script action - possible?

Post by Slayd »

Here are two scenarios, I would like to suppress the first three line group and show the second three line group

Code: Select all

Kazuko balls up one fist and hammerfists Nullis.
He connects to the right leg!
3142h, 2882m, 14610e, 12000w ex-

Code: Select all

Kazuko balls up one fist and hammerfists you.
He connects to the left leg!
1600h, 2882m, 14488e, 11992w cexkdb-13-
Is there a way to use the first line of group 1 as a filter AND run deleteLine() script?
is there a way to get a deleteLine() script to run against multiline AND trigger lines?

Thanks

Jor'Mox
Posts: 1146
Joined: Wed Apr 03, 2013 2:19 am

Re: filter trigger that has script action - possible?

Post by Jor'Mox »

The deleteLine() function runs on the line where the cursor is placed. When the trigger fires, the cursor will be on the last line of your and trigger. If you know where the other line is relative to that, you can move the cursor using the moveCursor() function, and then call deleteLine() to delete the line you moved the cursor to.

In this case, assuming your trigger fires on the line with all the numbers, you could do this:
Code: [show] | [select all] lua
moveCursor(0,getLineNumber()-2)
deleteLine()
That would just get rid of the top line. I haven't personally played around with deleting multiple lines at a time, but you may just be able to call deleteLine() a few more times to cut them all out. A little experimentation should sort that out fairly quickly, I would think.

Slayd
Posts: 102
Joined: Mon Jul 25, 2011 4:57 am

Re: filter trigger that has script action - possible?

Post by Slayd »

You've given me some good ideas to try. Thanks

Post Reply