Guest User

startup

a guest
Aug 10th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.32 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. function radius(pos)
  4.   return math.sqrt((pos.X)^2+(pos.Z)^2)
  5. end
  6.  
  7. local ss = sensor.wrap("right")
  8.  
  9. while true do
  10.   local signal = true
  11.   local me = ss.getTargets()["Matplotlib"]
  12.   if me~=nil then
  13.     signal = (radius(me.Position)>5)
  14.   end
  15.   redstone.setOutput("left",signal)
  16. end
Advertisement
Add Comment
Please, Sign In to add comment