Advertisement
Guest User

tuer

a guest
Jul 5th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.52 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. local proximity = sensor.wrap("left")
  3.  
  4. while true do
  5.   local signal = true
  6.   local targets = proximity.getTargets()
  7.   for k, v in pairs(targets) do
  8.         if ((v.Position.X>=-0.5 and v.Position.X<=4
  9.         and v.Position.Z<=3 and v.Position.Z>=-3) or
  10.         (v.Position.Z>=-2.5 and v.Position.Z<=2.5
  11.         and v.Position.X>=3.5 and v.Position.X<=9))
  12.         and v.Position.Y>=0 and v.Position.Y<=6 then
  13.           signal = false  
  14.         end
  15.   end
  16.   rs.setOutput("top", signal)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement