Klazam33

TreeFarm

Jun 27th, 2014 (edited)
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.10 KB | None | 0 0
  1. os.loadAPI("kapi")
  2.  
  3. while true do
  4. kapi.menu("Manual Treefarm\n\nPut sapling in slot 1.\nPut fuel (if needed) in slot 2\nPress enter to chop.\nPress R to refuel.\nPress A to automate treefarm.\n\nCAUTION: This program doesn't have a sapling suck function, so hang around!")
  5. kapi.printFuel()
  6. keypress = kapi.keyread()
  7. if keypress == keys.enter then -- Chopping
  8.     print("Executing target tree")
  9.     kapi.chop()
  10.     kapi.turn("b")
  11.     kapi.dump(2)
  12.     turtle.select(1)
  13.     kapi.turn("b")
  14.     kapi.place("f")
  15. elseif keypress == keys.r then -- Refuelling
  16.     turtle.select(2)
  17.     turtle.refuel()
  18.     turtle.select(1)
  19. elseif keypress == keys.a then -- Automation
  20.     kapi.clear()
  21.     kapi.menu("Are you sure? \nThis is a pain to undo.\nPress Y to keep going\n")
  22.     keypressA = kapi.keyread()
  23.     if keypressA == keys.y then --
  24.         shell.run("delete startup")
  25.         shell.run("label set LukeBot3000")
  26.         shell.run("pastebin get jVFKXAam startup")
  27.     else
  28.         print("Not valid input! Press Enter to return to main menu.")
  29.         kapi.rawread(keys.enter)
  30.     end
  31. else
  32.     print("Not valid input! Press Enter to return to main menu.")
  33.     kapi.rawread(keys.enter)
  34. end
  35. end
Add Comment
Please, Sign In to add comment