Klazam33

HyperRefuel

Mar 15th, 2013 (edited)
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.48 KB | None | 0 0
  1. os.loadAPI("kapi")
  2.  
  3. function drink(n)
  4.  turtle.select(1)
  5.  kapi.place(n)
  6.  turtle.refuel()
  7. end
  8.  
  9. while true do
  10.  kapi.menu("HyperRefuel\n\nPut bucket in slot 1.\nPut fuel in slot 2.\nPress V for Volcano Mode.\nPress N for Nether Mode.\nPress R to refuel.")
  11.  kapi.printFuel()
  12.  keypress = kapi.keyread()
  13.  if keypress == keys.v then -- Volcano Mode
  14.   kapi.clear()
  15.   print("Make sure that I'm directly above the main lava tube.\nAND DONT FORGET BUCKET!\n\nPress Enter to execute program.")
  16.   kapi.rawread(keys.enter)
  17.   kapi.clear()
  18.   print("Executing.")
  19.   y = 0
  20.   while not turtle.detectDown() do
  21.    drink("d")
  22.    kapi.down()
  23.    y = y + 1
  24.   end
  25.   kapi.up(y-0)
  26.   print("Done")
  27.   kapi.printFuel()
  28.   kapi.rawread(28)
  29.  elseif keypress == keys.n then -- Nether Mode
  30.   kapi.clear()
  31.   print("Place me on the shore of a lava lake.\nAND DONT FORGET BUCKET!\n\nPress Enter to execute program.")
  32.   kapi.rawread(keys.enter)
  33.   kapi.forward()
  34.   drink("d")
  35.   kapi.down()
  36.   x = 0
  37.   while not turtle.detect() and (x-0) < 30 do
  38.    kapi.turn("r")
  39.    drink("f")
  40.    kapi.turn("b")
  41.    drink("f")
  42.    kapi.turn("r")
  43.    drink("f")
  44.    drink("d")
  45.    kapi.forward()
  46.    x = x + 1
  47.   end
  48.   kapi.up(2)
  49.   kapi.turn("b")
  50.   kapi.forward(x+1)
  51.   print("Done")
  52.   kapi.printFuel()
  53.   kapi.rawread(28)
  54.  elseif keypress == keys.r then
  55.   turtle.select(2)
  56.   turtle.refuel()
  57.  elseif keypress == 1 then
  58.  else
  59.   print("Not valid input! Press Enter to return to main menu.")
  60.   kapi.rawread(keys.enter)
  61.  end
  62. end
Add Comment
Please, Sign In to add comment