Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function initBigNumInstall()
- if fs.exists(inst_folder.."BigNum.lua") then
- local input = ""
- term.write("BigNum.lua already exists. Overwrite?(y/n): ")
- input = read()
- while (input ~= "y") and input ~= "Y" and input ~= "n" and input ~= "N" do
- term.write("Invalid option. Input \"y\" or \"n\": ")
- input = read()
- end
- if input == "y" or input == "Y" then
- fs.delete(inst_folder.."BigNum.lua")
- installBigNum()
- end
- else
- installBigNum()
- end
- end
- function installBigNum()
- shell.run("wget https://raw.githubusercontent.com/ennorehling/euler/master/BigNum.lua "..inst_folder.."BigNum.lua")
- os.sleep(0.5)
- local bignum_file = fs.open(inst_folder.."BigNum.lua","a")
- bignum_file.write("\nreturn BigNum")
- bignum_file.close()
- end
- function installRSA()
- if fs.exists(inst_folder.."RSA.lua") then
- local input = ""
- term.write("RSA.lua already exists. Overwrite?(y/n): ")
- input = read()
- while (input ~= "y") and input ~= "Y" and input ~= "n" and input ~= "N" do
- term.write("Invalid option. Input \"y\" or \"n\": ")
- input = read()
- end
- if input == "y" or input == "Y" then
- fs.delete(inst_folder.."RSA.lua")
- shell.run("pastebin get BckQ1JyV "..inst_folder.."RSA.lua")
- end
- else
- shell.run("pastebin get BckQ1JyV "..inst_folder.."RSA.lua")
- end
- end
- term.write("Installation Folder?: ")
- inst_folder = read()
- if inst_folder:sub(#inst_folder,#inst_folder) ~= "/" then
- inst_folder = inst_folder.."/"
- end
- initBigNumInstall()
- installRSA()
- term.setTextColor(colors.green)
- print("Installation finished successfully. Press any key to close this installer")
- os.pullEvent("key")
- term.setTextColor(colors.white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement