diff options
author | khonkhortisan <khonkhortisan@gmail.com> | 2013-06-19 19:38:34 -0700 |
---|---|---|
committer | khonkhortisan <khonkhortisan@gmail.com> | 2013-06-20 09:30:26 -0700 |
commit | 885899cbaf6ccb2d22a3495131204ea0d01131ed (patch) | |
tree | 93269364b92cfa582cbd027f428934161fb9c82d /mesecons_microcontroller/init.lua | |
parent | 6efe579f68eff1deaa08cf34e44d0c0411f8c498 (diff) |
Crossover
Diffstat (limited to 'mesecons_microcontroller/init.lua')
-rw-r--r-- | mesecons_microcontroller/init.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mesecons_microcontroller/init.lua b/mesecons_microcontroller/init.lua index 0f6a7cd..99ccb8a 100644 --- a/mesecons_microcontroller/init.lua +++ b/mesecons_microcontroller/init.lua @@ -635,10 +635,18 @@ function yc_get_real_portstates(pos) -- port powered or not (by itself or from o rulesC = mesecon:get_rules("mesecons_microcontroller:microcontroller0100") rulesD = mesecon:get_rules("mesecons_microcontroller:microcontroller1000") L = { - a = mesecon:is_power_on({x=pos.x+rulesA[1].x, y=pos.y+rulesA[1].y, z=pos.z+rulesA[1].z}) and mesecon:rules_link({x=pos.x+rulesA[1].x, y=pos.y+rulesA[1].y, z=pos.z+rulesA[1].z}, pos), - b = mesecon:is_power_on({x=pos.x+rulesB[1].x, y=pos.y+rulesB[1].y, z=pos.z+rulesB[1].z}) and mesecon:rules_link({x=pos.x+rulesB[1].x, y=pos.y+rulesB[1].y, z=pos.z+rulesB[1].z}, pos), - c = mesecon:is_power_on({x=pos.x+rulesC[1].x, y=pos.y+rulesC[1].y, z=pos.z+rulesC[1].z}) and mesecon:rules_link({x=pos.x+rulesC[1].x, y=pos.y+rulesC[1].y, z=pos.z+rulesC[1].z}, pos), - d = mesecon:is_power_on({x=pos.x+rulesD[1].x, y=pos.y+rulesD[1].y, z=pos.z+rulesD[1].z}) and mesecon:rules_link({x=pos.x+rulesD[1].x, y=pos.y+rulesD[1].y, z=pos.z+rulesD[1].z}, pos) + a = mesecon:is_power_on(mesecon:addPosRule(pos, rulesA[1]), + mesecon:invertRule(rulesA[1])) and + mesecon:rules_link(mesecon:addPosRule(pos, rulesA[1]), pos), + b = mesecon:is_power_on(mesecon:addPosRule(pos, rulesB[1]), + mesecon:invertRule(rulesB[1])) and + mesecon:rules_link(mesecon:addPosRule(pos, rulesB[1]), pos), + c = mesecon:is_power_on(mesecon:addPosRule(pos, rulesC[1]), + mesecon:invertRule(rulesC[1])) and + mesecon:rules_link(mesecon:addPosRule(pos, rulesC[1]), pos), + d = mesecon:is_power_on(mesecon:addPosRule(pos, rulesD[1]), + mesecon:invertRule(rulesD[1])) and + mesecon:rules_link(mesecon:addPosRule(pos, rulesD[1]), pos), } return L end |