Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Using AddTriggerEx with multiple trigger flags

Using AddTriggerEx with multiple trigger flags

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Oligo   (26 posts)  Bio
Date Wed 17 Apr 2013 09:16 PM (UTC)
Message
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

mud.arctic.org : 2700
Top

Posted by Oligo   (26 posts)  Bio
Date Reply #1 on Thu 18 Apr 2013 03:00 AM (UTC)

Amended on Thu 18 Apr 2013 08:59 PM (UTC) by Oligo

Message
Searching some threads, I think I figured it out.
Needed the bitwise library.


 bit.bor(trigger_flag.Enabled, trigger_flag.RegularExpression, trigger_flag.OneShot)

mud.arctic.org : 2700
Top

Posted by Fiendish   USA  (2,558 posts)  Bio   Global Moderator
Date Reply #2 on Thu 18 Apr 2013 03:10 AM (UTC)
Message
use arithmetic addition

https://github.com/fiendish/aardwolfclientpackage
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


14,356 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.