and gate:
if a { if b { do thing } }
or gate:
if a { do thing, c=1 }, if b { if c=0 { do thing } }
xor gate:
if a { c=1 }, if b { d=1 }, if not c=d { do thing }
nand gate:
if not a { do thing, c=1 }, if not b { if c=0 { do thing } }
nor gate:
if not a { if not b { do thing } }
xnor gate:
if a { c=1 }, if b { d=1 }, if c=d { do thing }
if c and d are set to 0 before this (they auto are if they are local and it's their first use in event) this works