-- Pocket Control Startup Script -- Automatically downloads and runs the latest pocketcontrol.lua from git local SCRIPT_URL = "https://git.spatulaa.com/MayaTheShy/remoteturtle/raw/branch/master/pocketcontrol.lua" local SCRIPT_NAME = "pocketcontrol.lua" print("========================================") print(" POCKET CONTROL AUTO-UPDATER") print("========================================") print("") -- Remove old version if fs.exists(SCRIPT_NAME) then print("Removing old version...") fs.delete(SCRIPT_NAME) end -- Download latest version print("Downloading latest version...") print("URL: " .. SCRIPT_URL) local response = http.get(SCRIPT_URL) if response then local content = response.readAll() response.close() -- Save to file local file = fs.open(SCRIPT_NAME, "w") file.write(content) file.close() print("✓ Download successful!") print("") print("Starting pocket control...") sleep(1) -- Run the script shell.run(SCRIPT_NAME) else print("✗ Download failed!") print("Please check:") print(" - Internet connection") print(" - URL is correct") print(" - HTTP API is enabled") print("") print("Falling back to existing script...") -- Try to run existing version if download fails if fs.exists(SCRIPT_NAME) then shell.run(SCRIPT_NAME) else print("No existing script found!") print("Please download manually:") print(" wget " .. SCRIPT_URL .. " " .. SCRIPT_NAME) end end