Advertisement
0xSRK6

Untitled

Feb 11th, 2021 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. --15x65
  2.  
  3. local arg = ...
  4. local lw = {15, 64}
  5. local itlw = {0, 0}
  6. local blockDetected = false
  7. local offRow = false
  8.  
  9. if arg == "scan" then
  10. local file = fs.open("data.txt", "r")
  11. itlw[1] = tonumber(file.readLine() or 0)
  12. itlw[2] = tonumber(file.readLine() or 0)
  13. file.close()
  14. end
  15.  
  16.  
  17.  
  18.  
  19.  
  20. turtle.select(1)
  21. for i = itlw[1], lw[2] do
  22. for j = itlw[2], lw[1] do
  23. if turtle.getItemCount() == 0 then
  24. if turtle.getSelectedSlot() == 16 then
  25. local cFile = fs.open("data.txt", "w")
  26. cFile.writeLine(tostring(j))
  27. cFile.writeLine(tostring(i))
  28. cFile.close()
  29. os.reboot()
  30. end
  31. turtle.select(turtle.getSelectedSlot() + 1)
  32. else
  33. turtle.forward()
  34. turtle.placeDown()
  35. end
  36. end
  37. if offRow and turtle.getSelectedSlot() ~= 16 then
  38. turtle.turnLeft()
  39. turtle.forward()
  40. turtle.placeDown()
  41. turtle.turnLeft()
  42. offRow = false
  43. elseif not offRow and turtle.getSelectedSlot() ~= 16 then
  44. turtle.turnRight()
  45. turtle.forward()
  46. turtle.placeDown()
  47. turtle.turnRight()
  48. offRow = true
  49. end
  50.  
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement