Glitchies

turtle.floors

Aug 27th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.09 KB | None | 0 0
  1. local tArgs = {...}
  2. turtle.forward()
  3. print(tArgs[1]..":"..tArgs[2])
  4. x = tonumber(tArgs[1])
  5. y = tonumber(tArgs[2])
  6. local slot = 1
  7. turtle.select(slot)
  8. local function slotChecker()
  9.     while turtle.getItemCount(slot) == 0 do
  10.        slot = slot + 1
  11.           if slot == 17 then
  12.              print("Inventory Empty! Refill and Press a Key.")
  13.              local event, param = os.pullEvent()
  14.              if event == "key" then
  15.              slot = 1
  16.              end
  17.           end
  18.        turtle.select(slot)
  19.        print("Switching to " .. slot)
  20.     end
  21. end
  22. slotChecker()
  23. print("starting in 5...")
  24. sleep(5)
  25. turtle.placeDown()
  26.  
  27. for j = 1, y do
  28.    for i = 1, x-1 do
  29.       turtle.forward()
  30.       slotChecker()
  31.       turtle.placeDown()
  32.    end
  33.    if j~= y then
  34.       if j % 2 == 0 then
  35.          turtle.turnRight()
  36.          turtle.forward()
  37.          slotChecker()
  38.          turtle.placeDown()
  39.          turtle.turnRight()
  40.       else
  41.          turtle.turnLeft()
  42.          turtle.forward()
  43.          slotChecker()
  44.          turtle.placeDown()
  45.          turtle.turnLeft()
  46.       end
  47.    end
  48. end
Advertisement
Add Comment
Please, Sign In to add comment