Advertisement
Clem2095

mkfloor v0.1

Jul 25th, 2013
1,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. local tArgs = { ... }
  2.  
  3. turtle.refuel()
  4. print("Making a  brand new floor!")
  5.  
  6. print("I have "..turtle.getItemCount(16).." blocks for use!")
  7.  
  8. local finished=false
  9. local selected=16
  10. local total=0
  11.  
  12. turtle.select(selected)
  13. while not finished do
  14.     while not(turtle.detect() or turtle.detectDown()) do
  15.         if turtle.placeDown() then
  16.             total=total+1
  17.         end
  18.         turtle.forward()
  19.  
  20.         -- change the block slot if no more left!
  21.         if turtle.getItemCount(selected) == 0 then
  22.             selected=selected-1
  23.             turtle.select(selected)
  24.             local blocks = turtle.getItemCount(selected)
  25.             print("Switched to slot ".. selected .. " now having ".. blocks .." for use!")
  26.         end
  27.     end
  28.  
  29.     if turtle.detectDown() then
  30.         turtle.back()
  31.         turtle.turnRight()
  32.         turtle.forward()
  33.  
  34.         if turtle.detectDown() then
  35.             print("Floor finished!")
  36.             finished=true
  37.         end
  38.     else
  39.         turtle.turnRight()
  40.     end
  41. end
  42.  
  43. print("I have useed ".. total .. " to make your new floor <(' -' <)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement