SHARE
TWEET

blockPlacer.lua

fatboychummy Aug 25th, 2019 (edited) 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top