wv1106

bridging script computercraft

Jan 3rd, 2021 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. --put blocks in the inventory of the turtle and specefie how far he needs to go when you start the program
  2. --remember to put enough fuel before starting
  3.  
  4.  
  5. local tArgs = {...}
  6.  
  7. rtrn = 0
  8. afst = 0
  9. sel = 0
  10.  
  11. if #tArgs~=1 then
  12.     print("not enough info please specefie length")
  13. end
  14.  
  15. lengte = tonumber(tArgs[1])
  16.  
  17. function info()
  18.     print("fuel: "..turtle.getFuelLevel())
  19.     print("length: "..lengte)
  20.     print("made by wv1106 on reddit and pastebin")
  21. end
  22.  
  23. function move()
  24.     if turtle.forward() then
  25.         afst = afst + 1  
  26.     end
  27. end
  28.  
  29. function place()
  30.     if not turtle.detectDown() then
  31.         while not turtle.placeDown() do
  32.             sel = sel + 1
  33.             turtle.select(sel)
  34.         end
  35.     end
  36. end
  37.    
  38. --here starts ectual code
  39.  
  40. info()
  41. for i=1,lengte do
  42.     move()
  43.     place()
  44. end
  45. turtle.turnLeft()
  46. turtle.turnLeft()
  47. for i=1,afst do
  48.     if not turtle.forward() then
  49.         turtle.attack()
  50.        
  51.     end
  52. end
  53.  
  54. print("finished!")
Add Comment
Please, Sign In to add comment