Advertisement
Emuq

Sensor Map

Aug 26th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2.  
  3. s = sensor.wrap("right")
  4. m = peripheral.wrap("left")
  5. m.setTextScale(0.5)
  6. m.setTextColor(colors.black)
  7. x,z = m.getSize()
  8. term.redirect(m)
  9. while true do
  10.   os.sleep(0.3)
  11.   term.setBackgroundColor(colors.black)
  12.   term.clear()
  13.   --paintutils.drawFilledBox(0,0,x,z,16)
  14.   t = s.getTargets()
  15.   for k, v in pairs(t) do
  16.     pos = v.Position
  17.     paintutils.drawPixel(x/2-pos.Z,z/2+pos.X,1)
  18.     print(k)
  19.   end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement