(Triggers) Lua function option

Post Reply
Justin
Posts: 2
Joined: Sat Aug 07, 2010 3:03 pm
Contact:

(Triggers) Lua function option

Post by Justin » Wed Oct 06, 2010 2:39 pm

I spoke with Vadi last night about this, but I still couldn't get it to work. Quite simply, in Aetolia, there are messages such as... "You are afflicted with <affliction>." and I want to do a trigger chain on them, but -only- if I have system.auto.bashing = 1

I made a function called "IsBashing()" which returns either a true, or false.

I made a trigger called Affliction.. The first trigger-line is, "You are afflicted with", and made the type a: begin of line substring.
The second trigger-line I made, "IsBashing()", with type of: Lua function

I then turned on multiline / AND Trigger (left line delta at 0, but I played with it for a bit- I don't know what it means).

So, I assumed that it would match 'You are afflicted with", then call "IsBashing()" - which would then return true or false. If true, it would continue my trigger chain, which holds.. epilepsy, paralysis, etc. If false, it would simply halt there.

However I cannot get this to work. If anyone could explain -how- if it's even possible, that'd be great. If not, if they could explain what the point of the Lua function option is, that would also be great. :)

Thanks.

Parnakra
Posts: 35
Joined: Tue Apr 21, 2009 10:48 am

Re: (Triggers) Lua function option

Post by Parnakra » Wed Oct 06, 2010 4:18 pm

I haven't used functions in triggers extensively and I don't know if this will solve your problem completely, but I believe you have to put in 'return isBashing()' instead of just 'isBashing()'.

Hope it helps.

Justin
Posts: 2
Joined: Sat Aug 07, 2010 3:03 pm
Contact:

Re: (Triggers) Lua function option

Post by Justin » Wed Oct 06, 2010 4:31 pm

That worked, thanks! I'm glad I had the original logic correct- I was just missing the 'return' keyword.

I think this way (for me, at least) is definitely much better than having a second trigger group that I have to enable/disable on the fly. :)

Thanks again!!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest