FuturedPanda

Sugar Cane

Jan 19th, 2023 (edited)
937
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --VARIABLES
  2.  
  3. SUGARCANELENGTH = 20
  4. WAITTIME = 250
  5.  
  6.  
  7. --FUNCTIONS
  8.  
  9. function DTF()
  10.     turtle.dig()
  11.     turtle.turnRight()
  12.     turtle.forward()
  13.     turtle.turnLeft()    
  14. end
  15.  
  16.  
  17. function wakeUp()
  18.     turtle.up()
  19.     turtle.turnRight()
  20.     turtle.forward()
  21.     turtle.turnLeft()
  22. end
  23.  
  24.  
  25. function gotoSleep()
  26.     turtle.turnLeft()
  27.     for i = 1, SUGARCANELENGTH, 1 do
  28.        
  29.         turtle.forward()
  30.        
  31.     end
  32.     turtle.forward()
  33.     turtle.down()
  34.     turtle.turnRight()
  35.  
  36. end
  37.  
  38. function Lane()
  39.  
  40.     wakeUp()
  41.  
  42.  
  43.  
  44.     for i = 1, SUGARCANELENGTH, 1 do
  45.         DTF()
  46.     end
  47.  
  48.     gotoSleep()
  49.  
  50. end
  51.  
  52. --MAIN
  53.  
  54. while true do
  55.    
  56.     Lane()
  57.  
  58.     --Advance to Next Lane
  59.     turtle.forward()
  60.     turtle.forward()
  61.  
  62.  
  63.     Lane()
  64.  
  65.  
  66.     --Regress
  67.     turtle.back()
  68.     turtle.back()
  69.  
  70.  
  71.     sleep(WAITTIME)
  72.  
  73. end
  74.  
  75.  
Advertisement
Add Comment
Please, Sign In to add comment