Advertisement
Guest User

startup

a guest
Dec 1st, 2015
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. rednet.open("top")
  2. os.loadAPI("ocs/apis/sensor")
  3. os.loadAPI("monmon")
  4.  
  5. m = peripheral.wrap("left")
  6.  
  7. local prox = sensor.wrap("bottom")
  8.  
  9. print(textutils.serialise(prox.getTargets()))
  10.  
  11. local targets = prox.getTargets()
  12.  
  13. while true do
  14. i=0
  15. monmon.loadImage("b1")
  16.  
  17. local targets = prox.getTargets()
  18.  
  19. for k, v in pairs(targets) do
  20.   if v.Name == "Blaze" then
  21.     if v.Position.Y == 1 then
  22.      i=i+1
  23.     end
  24.   end
  25. end
  26.  print(i)
  27.  rednet.broadcast(i)
  28.  
  29.  m.setBackgroundColor(colors.black)
  30.  m.setTextColor(colors.lime)
  31.  m.setCursorPos(12,10)
  32.  m.write("   ")
  33.  m.setCursorPos(12,10)
  34.  m.write(math.abs(i))
  35.  sleep(1)
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement