Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not fs.exists("kapi") then
- shell.run("label set KlazTurtle")
- shell.run("pastebin get Wa30xjVY kapi")
- shell.run("pastebin get 4wViUFbv MineShaft")
- shell.run("pastebin get Ybfk4mFM HyperRefuel")
- shell.run("pastebin get 42ZuYW7f TreeFarm")
- os.loadAPI("kapi")
- else
- os.loadAPI("kapi")
- end
- --Table of options
- option = {"MineShaft", "HyperRefuel", "TreeFarm", "Advanced Options"}
- advOption = {"Update All", "Update API", "Update Installer", "Reformat Turtle", "Exit"}
- --Variables
- l = #option
- vl = #advOption
- n = 1 --For Option Table
- o = 1 --For advOption Table
- while true do
- kapi.menu("Please select a program from the following:")
- for i = 1, l, 1 do
- if n == i then
- print(">" .. option[i] .. "<")
- else
- print(" " .. option[i])
- end
- end
- keypress = kapi.keyread()
- if keypress == keys.up then --Up Arrow
- if n == 1 then
- n = l
- else
- n = n - 1
- end
- elseif keypress == keys.down then --Down Arrow
- if n == l then
- n = 1
- else
- n = n + 1
- end
- elseif keypress == keys.enter then --Enter key
- kapi.clear()
- if option[n] == "Advanced Options" then
- while true do
- kapi.menu("Select one of the following options.")
- for i = 1, vl, 1 do
- if o == i then
- print(">" .. advOption[i] .. "<")
- else
- print(" " .. advOption[i])
- end
- end
- keypress = kapi.keyread()
- if keypress == keys.up then --Up Arrow
- if o == 1 then
- o = al
- else
- o = o - 1
- end
- elseif keypress == keys.down then --Down Arrow
- if o == al then
- o = 1
- else
- o = o + 1
- end
- elseif keypress == keys.enter then --Enter key
- if advOption[o] == "Update All" then
- shell.run("delete MineShaft")
- shell.run("delete HyperRefuel")
- shell.run("delete TreeFarm")
- print("Old versions deleted. Updating now.")
- shell.run("pastebin get 4wViUFbv MineShaft")
- shell.run("pastebin get Ybfk4mFM HyperRefuel")
- shell.run("pastebin get 42ZuYW7f TreeFarm")
- print("Update done! Press Enter to return to main menu.")
- kapi.rawread(keys.enter)
- elseif advOption[o] == "Update API" then
- shell.run("delete kapi")
- print("Old API deleted.")
- shell.run("pastebin get Wa30xjVY kapi")
- print("Update done! Press Enter to return to main menu.")
- kapi.rawread(keys.enter)
- elseif advOption[o] == "Update Installer" then
- print("Deleting old Installer")
- shell.run("delete startup")
- shell.run("pastebin get aWFTCV3M startup")
- print("Installer updated! Press Enter to reboot.")
- kapi.rawread(keys.enter)
- os.reboot()
- elseif advOption[o] == "Reformat Turtle" then
- shell.run("label clear")
- print("IF YOU DONT WANT TO LOSE FUEL, RELABEL BEFORE BREAKING")
- kapi.rawread(keys.enter)
- os.reboot()
- elseif advOption[o] == "Exit" then
- break
- else
- end
- end
- end
- else
- shell.run(option[n])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement