Advertisement
fatboychummy

blockPlacer.lua

Aug 25th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1.  
  2.  
  3. local function find()
  4.   for i = 1, 16 do
  5.     if turtle.getItemCount(i) > 0 then
  6.       turtle.select(i)
  7.       print("Selected " .. tostring(i))
  8.       return
  9.     end
  10.   end
  11.   error("No items.")
  12. end
  13.  
  14. local oldplc = turtle.place
  15. function turtle.place()
  16.   find()
  17.   return oldplc()
  18. end
  19.  
  20. while true do
  21.   print("Checking")
  22.   if not turtle.inspect() then
  23.     print("No block, placing")
  24.     turtle.place()
  25.   end
  26.   print("ok")
  27.   os.sleep(5)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement