The And/Or Actuator

This actuator type is very handy for performing the logical operations of 'AND" and 'OR'.  Examples of use:
A little thought will reveal that the first two of these examples are IDENTICAL in function.  These examples are included to demonstrate that the functions of AND and OR are equivalent.  You just have to reverse the inputs and outputs.  In this case the inputs are 'Switch pressed' (reverse is 'Switch not pressed') and the output is 'Door open' (reverse is 'Door closed').  Therefore, you can think of this actuator as performing either an 'AND' function or an 'OR' function.  This equivalence is known as DeMorgan's theorm.

I will talk of this gate as an AND gate for simplicity.   It has a four-bit 'memory'.  Each bit can be 'set' to 'True' or  'Cleared' to 'False'.  The values are initialized when the dungeon is designed and then are changed by sending Timer messages to the cell containing the Actuator.  Timer messages  are directed to a cell address and a position within that cell.  An And/Or gate is located at a particular position within the cell.  BUT!!!  In the case of an AND/Or gate, the position information is not used to locate the gate.  When a Timer message arrives at a cell, it is received by ALL And/Or gates in that cell, regardless of position.  The position information in the Timer message is used, instead, to determine which of the four bits in the gate's memory will be Set (to True) or Cleared (to False).

OK.  Now we have four bits of memory that can be independently initialized when the dungeon is designed and that can be independently Set or Cleared during gameplay by Timer messages.  Now we will add the 'Target' values.  These are four bits that are specified at design time and which cannot be changed during gameplay.  So let us name the 'Memory' bits M0, M1, M2, and M3.  And let us name the 'Target' bits T0, T1, T2, and T3.  The And/Or actuator tests whether (M0 equals T0) AND (M1 equals T1) AND (M2 equals T2) AND (M3 equals T3).  Hence the 'AND' part of its name.

That is the basic operation of the 'And/Or' Actuator.  The test for equivalence of the four memory bits and the four target bits.  But there are some added features that make the Actuator more versatile.

Let us talk of the Actuator as an ordinary light switch; like the one on the kitchen wall that controls the ceiling lamp.  The kitchen light is on when the switch is in the 'Up' position.  We will pretend that the Actuator contains an internal light switch.  Here is how it works:

Now it has been decided that we should send a Timer message of some sort.  The designer specified what sort of message to send.  There are four possibilities:
  1. Set.  If the switch is 'Up' send a 'Set' Timer message.  If the switch is 'Down' quit...do nothing.
  2. Clear.  If the switch is 'Up' send a 'Clear' Timer message.  If the switch is 'Down' quit...do nothing.
  3. Toggle.  If the switch is 'Up' send a 'Toggle' Timer message.  If the switch is 'Down' quit...do nothing.
  4. Hold.  If the switch is 'Up' send a 'Set' Timer message.  If the switch is 'Down' send a 'Clear' Timer message.
That is all there is to it.  Except that actually sending the message is accomplished by the function 'QueueSwitchAction'.  That function may disable this Actuator or perform some action other than sending a Timer message.

In the DM/CSB editor 'CSBuild' most of these details are hidden and the operation is specified in a bit more intuitive way.

************ Another Attempt to Explain This  *************
By Zyx

The question was "How to remove a trick wall with an and/or gate, with the condition of putting 2 coins on a slot coin plus 1 coin on another slot ? "

I'll try to explain in not too logical terms...
And/OR gates have 4 entries than can be ON or OFF.
When OFF, an entry has a value of 0.
The North entry has a value of 1 when ON.
The East entry has a value of 2 when ON.
The South entry has a value of 4 when ON.
The West entry has a value of 8 when ON.

This gives you 16 possible sums, from 0 (everything OFF) to 15 (everything ON).

Set the initial value to 0, so everything is OFF.
Set the target value to 7, so the AND/OR gate will be activated when north, east and south entries are set to ON.
The action, if Equal, should be "Set".
Target the trick wall.

Now, create a pushbutton, displayed as a Coin Slot, operated by coin that will remove the item, working once, targetting the AND/OR gate on NORTH, with a SET message.
Add another pushbutton on the same wall, displayed as a Coin Slot, operated by coin that will remove the item, working once, targetting the AND/OR gate on EAST, with a SET message.
This will do the double coin slot.

Finally, create a 3rd pushbutton on another wall, displayed as a Coin Slot, operated by coin that will remove the item, working once, targetting the AND/OR gate on SOUTH, with a SET message.