Using AddTriggerEx with multiple trigger flags

Posted by Oligo on Wed 17 Apr 2013 09:16 PM — 3 posts, 14,955 views.

#0
I'm having difficulty create a trigger that has multiple trigger flags using the AddTrigger() and AddTriggerEx() functions.

Ideally I would like the trigger to have 3 flags set: Enabled, Regular Expression, and OneShot. I've tried with both "or" and "and" and the pipe operator "|" doesn't seem to work in Lua.

I've also tried with both AddTrigger() and AddTriggerEx().


function loginMenu()
  if (not IsConnected()) then
    AddTriggerEx("login_char", "^What is your character's name?", "oligo", trigger_flag.Enabled or trigger_flag.RegularExpression or trigger_flag.OneShot, custom_colour.NoChange, 0, "", "",sendto.world,100)
    Connect()
  end
end
#1
Searching some threads, I think I figured it out.
Needed the bitwise library.


 bit.bor(trigger_flag.Enabled, trigger_flag.RegularExpression, trigger_flag.OneShot)
Amended on Thu 18 Apr 2013 08:59 PM by Oligo
USA Global Moderator #2
use arithmetic addition