How to:Create a trigger that:

Post Reply
Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

How to:Create a trigger that:

Post by Filion »

fires when it matches the same line twice

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: How to:Create a trigger that:

Post by Vadi »

Enable 'match all' checkbox.

Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

Re: How to:Create a trigger that:

Post by Filion »

hm, due to the nature of the script (statting script) i want it to engage only when there are 2 or more occurances of the same line. that won't solve the problem i think

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: How to:Create a trigger that:

Post by tsuujin »

just trigger for the occurrence of whatever you're looking for, then use the standard string library to pick out what you want from the whole line.

Filion
Posts: 93
Joined: Sat Mar 26, 2011 4:21 pm

Re: How to:Create a trigger that:

Post by Filion »

i want it to trigger when it meets two "a young sapling" in the room.

Gauroth
Posts: 22
Joined: Tue Sep 07, 2010 2:44 pm

Re: How to:Create a trigger that:

Post by Gauroth »

Last time I was trying to do something like this I had finagled it with the following:

Exact match: "a young sapling"
Code:
Code: [show] | [select all] lua
lastLine = getLines(getLineCount()-1, getLineCount())
if lastLine[1] == matches[1] then
	send(someCommand)
end
It wound up being a little delicate so I went a different route with what I was trying to do, but it might work out better for you. Of course if there is a more "official" way of doing this I'm sure it would be better, but I never did find it myself.

Post Reply