Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("AndysPrograms/api/update") == false then
- fs.makeDir("AndysPrograms/api")
- shell.run("cd","AndysPrograms/api")
- shell.run("pastebin","get","1niw24Vd","update")
- shell.run("cd","..")
- shell.run("cd","..")
- end
- launcherargs = {...}
- fudargs = "sleep(5)\nshell.run(\"farm\", \"noset\")"
- --print (fudargs)
- --sleep (5)
- farmlauncherloop = 1
- local stopfarm = 0
- errhnd = 0
- function cllfrm()
- farm.startfarm(launcherargs)
- end
- function errhndlr(err)
- if err == "Terminated" then
- stopfarm = 1
- else
- term.setCursorPos(1, 1)
- term.clear()
- print("Error, Rebooting...")
- term.setCursorPos(1, 3)
- print( "Error:",err)
- term.setCursorPos(1, 4)
- errhnd = 1
- sleep(2)
- end
- end
- local function ud()
- shell.run("AndysPrograms/api/update", "gt", "a3GBewNp", "AndysPrograms/api", "none", "none")
- shell.run("AndysPrograms/api/update", "farm", "ZW6q8wWs", "AndysPrograms/farm", "none", "no", unpack(launcherargs))
- end
- ud()
- while true do
- if stopfarm == 0 then
- local stu = fs.open("startup.lua", "w")
- stu.write(fudargs)
- stu.close()
- if errhnd == 0 then
- end
- os.loadAPI("AndysPrograms/farm/farm")
- if farmlauncherloop > 1 then
- launcherargs = {"noset"}
- end
- if xpcall(cllfrm,errhndlr) then
- ud()
- else
- sleep(2)
- errhnd = 0
- ud()
- end
- if errhnd ~= 0 then
- sleep(2)
- errhnd = 0
- end
- sleep(0)
- if farmlauncherloop < 100 then
- farmlauncherloop = farmlauncherloop + 1
- end
- else
- break
- end
- end
Add Comment
Please, Sign In to add comment