Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SEPERATOR = "======================================="
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- --// Configuration
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- -- fileName, pastebinId, runOnCloud
- local FILES = {
- {"boreBlacklist.lua",'3dbkNt7w',false},
- {"borev1.lua",'3PTsm5H1',true},
- {"borev2.lua",'7h9kZ1ZM',true},
- {"borev2-1.lua","VdYprGR1",true},
- {"floor.lua","nMxM1syd",true},
- {"lavaRefuel.lua","nFSUKiYE",false},
- {"update.lua",'jR4Xr7K0',true},
- }
- list = ""
- for i,v in pairs(FILES) do list = list..v[1]:gsub(".lua",""); if i ~= #FILES then list = list..", "; end end
- local STARTUP = [[
- shell.run("clear")
- print("Programs: ]]..list..[[\n\n")
- print("To change blacklist, use cmd \"set bore.blacklist [PASTEID]\".\n]]..SEPERATOR..[[")
- ]]
- local installer = {}
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- --// Initialization
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- function run(cmd) shell.run(cmd); end
- run("clear")
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- --// Functions
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- function Install()
- --// Verify choice
- print("Installing Mining Turtle software. Proceed?")
- local res = io.read()
- if string.lower(res) ~= "y" then return; end
- run("clear")
- --// Download files
- print("Downloading files...")
- for _,dat in pairs(FILES) do
- --shell.run("delete "..dat[1])
- if dat[3] then
- newPastebinFile(dat[1],dat[2])
- else
- downloadPaste(dat[1],dat[2])
- end
- print(dat[1].." installed...")
- sleep(0.5)
- end
- --// Make startup file
- makeStartup(STARTUP)
- --// Restart
- print("\n\nFinished.")
- sleep(1)
- run("clear")
- run("reboot")
- end
- --////////////////////////////////////////////////////////////////////////////////////////////////////
- function downloadPaste(name,id) -- old
- if fs.exists(name) then shell.run("delete "..name); end
- shell.run("pastebin get "..id.." "..name)
- end
- function makeStartup(str,paste) -- new
- if fs.exists("startup.lua") then shell.run("delete startup.lua"); end
- if paste then shell.run("pastebin get "..paste.." startup"); return; end
- local file = fs.open("startup.lua","w")
- file.write(str)
- file.close()
- end
- function newPastebinFile(name, id)
- if fs.exists(name) then shell.run("delete "..name); end
- local file = fs.open(name,"w")
- file.write("shell.run(\"pastebin run "..id.."\")")
- file.close()
- end
- Install();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement