Glitchies

turtle.spiral2

Jan 31st, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. peripheral.wrap("right")
  2. local tArgs = {...}
  3. local file = fs.open("save2", "r")
  4. local y = file.readAll()
  5. file.close()
  6. if tArgs[1] == nil then tArgs[1] = 1 end
  7. function legs()
  8.    for i = 1, y do
  9.           turtle.forward()
  10.    end
  11.    turtle.turnLeft()
  12.    y = y + 1
  13. end
  14. function whole()
  15.    for i = 1, 4 do
  16.           legs()
  17.    end
  18.    file = fs.open("save2" , "w")
  19.    file.write(y)
  20.    file.close()
  21. end
  22. for i = 1, tArgs[1] do
  23.    whole()
  24. end
Advertisement
Add Comment
Please, Sign In to add comment