If you create a macro and add two events, and an action to it, then the action will be performed if either of the events occurs (ie. OR).
Is it possible to only perform an action if both events occur (ie. AND) ?
I want to do this so that buttons have different effects, depending on whether the media player is in a paused state or not. At the moment, I enable/disable certain macros, depending on the state of the player (ie. Paused or not).
Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.
AND events together, instead of OR ?
- Pako
- Plugin Developer
- Posts: 2294
- Joined: Sat Nov 11, 2006 1:31 pm
- Location: Czech Republic
- Contact:
Re: AND events together, instead of OR ?
Code: Select all
#Python script Aon
eg.globals.var_A = TrueCode: Select all
#Python script Aoff
eg.globals.var_A = FalseCode: Select all
#Python script TriggerEvent
try:
if eg.globals.var_A:
eg.TriggerEvent("AandB",prefix = "MyEvent")
except:
passIf the event "MyEvent.B" occurs after the event "MyEvent.Aon", event "MyEvent.AandB" is triggered .
But if it's after the event "MyEvent.Aoff", nothing happens.
Pako