Advertisement
Te-ki

CC BlockPlacer

Feb 27th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. --ComputerCraft BlockPlacer by Teki
  2.  
  3. local filledSlot = 0
  4. local details
  5.  
  6. local function getfirstFilledSlot()
  7.     for i =1,16 do
  8.         details = turtle.getItemDetail(i)
  9.         if details ~= nil then
  10.             return i
  11.         end
  12.     end
  13.     return 0
  14. end
  15.  
  16. while true do
  17.     if redstone.getInput("back") then
  18.         filledSlot = getfirstFilledSlot()
  19.         if filledSlot ~= 0 then
  20.             turtle.select(filledSlot)
  21.             turtle.place()
  22.         end
  23.     end
  24.     sleep(0)
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement