Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tArgs = {...}
- mod = {}
- mod.background = {}
- logging = {}
- local function dl(url, file)
- fdl = http.get(url)
- f = fs.open(file,"w")
- f.write(fdl.readAll())
- f.close()
- end
- function mod.disable()
- if fs.exists("home/User-Programs/.ultramod/.mod") then
- print("Already disabled!")
- else
- print("Disabled UltraMod")
- fs.move("users/apis/edge","home/User-Programs/.ultramod/.mod")
- end
- end
- function mod.enable()
- if fs.exists("users/apis/edge") then
- print("Already enabled!")
- else
- print("Enabled UltraMod")
- fs.move("home/User-Programs/.ultramod/.mod","users/apis/edge")
- fs.delete("home/User-Programs/.ultramod/.mod")
- end
- end
- function mod.install()
- dl("http://www.pastebin.com/raw/PFqu9xJv","users/apis/edge")
- fs.copy(shell.getRunningProgram(),"users/apis/ultramod")
- os.loadAPI("Axiom/libraries/settings")
- settings.setVariable("Axiom/sys.axs","demo","UltraMod")
- end
- function logging.enable()
- edge.noLog = false
- end
- function logging.disable()
- edge.noLog = true
- end
- function mod.background.remove()
- print("Removed UltraMod Background")
- if fs.exists("home/User-Programs/.ultramod/images/ultramod.nfp") then
- fs.delete("home/User-Programs/.ultramod/images/ultramod.nfp")
- end
- end
- function mod.background.install()
- print("Installed UltraMod Background")
- if not edge then
- os.loadAPI("users/apis/edge")
- end
- if not fs.exists("home/User-Programs/.ultramod/images/ultramod.nfp") then
- f = fs.open("home/User-Programs/.ultramod/images/ultramod.nfp","w")
- f.write(edge.ultramodBackground)
- f.close()
- end
- end
- if tArgs[1] == "install" then
- print("Installing UltraMod.")
- mod.install()
- os.loadAPI("Axiom/libraries/edge")
- os.loadAPI("Axiom/libraries/settings")
- settings.setVariable("Axiom/settings.0","system_allow_apis","true")
- print("All set!")
- sleep(1)
- os.reboot()
- end
- if tArgs[1] == "disable" then
- mod.disable()
- end
- if tArgs[1] == "enable" then
- mod.enable()
- end
- if tArgs[1] == "background" and tArgs[2] == "install" then
- mod.background.install()
- end
- if tArgs[1] == "background" and tArgs[2] == "uninstall" then
- mod.background.remove()
- end
- if tArgs[1] == "help" then
- print("Usage:")
- print(shell.getRunningProgram().." install")
- print(shell.getRunningProgram().." disable/enable")
- print(shell.getRunningProgram().." background uninstall/install")
- print(shell.getRunningProgram().." help")
- print(shell.getRunningProgram().." status")
- end
- if tArgs[1] == "status" then
- if fs.exists("home/User-Programs/.ultramod/.mod") then
- print("UltraMod: Disabled")
- else
- print("Ultramod: Enabled")
- end
- if not fs.exists("home/User-Programs/.ultramod/images/ultramod.nfp") then
- print("Ultramod Background: Not present")
- else
- print("Ultramod Background: Is present")
- end
- if not edge then
- if os.loadAPI("users/apis/edge") == true then
- if edge.noLog == true then
- print("Ultramod logging: Enabled")
- else
- print("Ultramod logging: Disabled")
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment