teledong

Make_Wall

Jul 31st, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. tempSlot = 3
  2.  
  3. function checkItem()
  4.   if turtle.getItemCount(2) == 0 then
  5.     turtle.select(tempSlot)
  6.     turtle.transferTo(2)
  7.     turtle.select(2)
  8.     tempSlot = tempSlot + 1
  9.   end
  10. end
  11.  
  12. function checkFuel()
  13.   if turtle.getFuelLevel() < 100 then
  14.     turtle.select(1)
  15.     turtle.refuel()
  16.     trutle.select(2)
  17.   end
  18. end
  19.  
  20. print("Type Wall Size...")
  21. local wallsize = tonumber(read())
  22. checkFuel()
  23. turtle.select(2)
  24. local i = 1
  25. local j = 1
  26. while i <= 4 do
  27.   j = 1
  28.   while j <= wallsize-1 do
  29.     turtle.back()
  30.     turtle.place()
  31.     checkItem()    
  32.     j = j + 1
  33.     checkFuel()
  34.   end
  35.   i = i + 1
  36.   checkItem()
  37.   turtle.turnRight()
  38. end
Add Comment
Please, Sign In to add comment