BruceWplays

Farm Launcher V2 old(For V9.6)

Feb 14th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if fs.exists("AndysPrograms/api/update") == false then
  2.     fs.makeDir("AndysPrograms/api")
  3.     shell.run("cd","AndysPrograms/api")
  4.     shell.run("pastebin","get","1niw24Vd","update")
  5.     shell.run("cd","..")
  6.     shell.run("cd","..")
  7. end
  8. launcherargs = {...}
  9. fudargs = "sleep(5)\nshell.run(\"farm\", \"noset\")"
  10. --print (fudargs)
  11. --sleep (5)
  12. farmlauncherloop = 1
  13. local stopfarm = 0
  14. errhnd = 0
  15. function cllfrm()
  16.     farm.startfarm(launcherargs)
  17. end
  18.  
  19. function errhndlr(err)
  20.     if err == "Terminated" then
  21.         stopfarm = 1
  22.     else
  23.         term.setCursorPos(1, 1)
  24.         term.clear()
  25.         print("Error, Rebooting...")
  26.         term.setCursorPos(1, 3)
  27.         print( "Error:",err)
  28.         term.setCursorPos(1, 4)
  29.         errhnd = 1
  30.         sleep(2)
  31.     end
  32. end
  33.  
  34. local function ud()
  35.     shell.run("AndysPrograms/api/update", "gt", "a3GBewNp", "AndysPrograms/api", "none", "none")
  36.     shell.run("AndysPrograms/api/update", "farm", "ZW6q8wWs", "AndysPrograms/farm", "none", "no", unpack(launcherargs))
  37. end
  38. ud()
  39.  
  40. while true do
  41.     if stopfarm == 0 then
  42.         local stu = fs.open("startup.lua", "w")
  43.         stu.write(fudargs)
  44.         stu.close()
  45.         if errhnd == 0 then
  46.  
  47.         end
  48.         os.loadAPI("AndysPrograms/farm/farm")
  49.         if farmlauncherloop > 1 then
  50.             launcherargs = {"noset"}
  51.         end
  52.        
  53.         if xpcall(cllfrm,errhndlr) then
  54.             ud()
  55.         else
  56.             sleep(2)
  57.             errhnd = 0
  58.             ud()
  59.         end
  60.  
  61.        
  62.         if errhnd ~= 0 then
  63.             sleep(2)
  64.             errhnd = 0
  65.         end
  66.         sleep(0)
  67.         if farmlauncherloop < 100 then
  68.             farmlauncherloop = farmlauncherloop + 1
  69.         end
  70.     else
  71.         break
  72.     end
  73. end
Add Comment
Please, Sign In to add comment