Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- local proximity = sensor.wrap("left")
- while true do
- local signal = true
- local targets = proximity.getTargets()
- for k, v in pairs(targets) do
- if ((v.Position.X>=-0.5 and v.Position.X<=4
- and v.Position.Z<=3 and v.Position.Z>=-3) or
- (v.Position.Z>=-2.5 and v.Position.Z<=2.5
- and v.Position.X>=3.5 and v.Position.X<=9))
- and v.Position.Y>=0 and v.Position.Y<=6 then
- signal = false
- end
- end
- rs.setOutput("top", signal)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement