(Triggers) Lua function option

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

(Triggers) Lua function option

Post by Justin »

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 »

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

Re: (Triggers) Lua function option

Post by Justin »

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