--[[ AUTO PRESTIGE FARM v10 - Smart Pause + Stuck Detection --]] -- =========== CONFIG =========== local CLICK_RATE = 0.01 local SCAN_RATE = 0.25 local MENU_RATE = 0.25 local POST_PRESTIGE = 0.8 local POST_CONFIRM = 0.8 local PAUSE_KEY = Enum.KeyCode.F6 local USER_PAUSE_TIME = 2.0 -- how long to back off after a user click local USER_DIST_THRESH = 80 -- pixels from bot's target = user click local STUCK_TIMEOUT = 30 -- seconds with no progress = stuck local WEBHOOK_URL = "" local WEBHOOK_USER = "AutoPrestige Bot" -- ============================== local Players = game:GetService("Players") local VIM = game:GetService("VirtualInputManager") local UIS = game:GetService("UserInputService") local GS = game:GetService("GuiService") local VirtualUser = game:GetService("VirtualUser") local HttpService = game:GetService("HttpService") local LP = Players.LocalPlayer local PG = LP:WaitForChild("PlayerGui") if getgenv().AutoPrestigeRunning then getgenv().AutoPrestigeRunning = false task.wait(0.5) end getgenv().AutoPrestigeRunning = true getgenv().AutoPrestigePaused = false local oldGui = LP.PlayerGui:FindFirstChild("AutoPrestigePanel") if oldGui then oldGui:Destroy() end local stats = { startTime=tick(), clicks=0, battles=0, prestiges=0, stuckRecoveries=0, status="Idle" } local lastClickX, lastClickY = -9999, -9999 local userActiveUntil = 0 local lastProgress = tick() local function sendWebhook(content) if WEBHOOK_URL == "" then return end local req = (syn and syn.request) or (http and http.request) or http_request or request if not req then return end pcall(function() req({ Url = WEBHOOK_URL, Method = "POST", Headers = {["Content-Type"]="application/json"}, Body = HttpService:JSONEncode({username=WEBHOOK_USER, content=content}), }) end) end LP.Idled:Connect(function() VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new()) end) local hotkeyConn = UIS.InputBegan:Connect(function(input, processed) if processed then return end if input.KeyCode == PAUSE_KEY then getgenv().AutoPrestigePaused = not getgenv().AutoPrestigePaused end end) local userInputConn = UIS.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 and input.Position then local dx = math.abs(input.Position.X - lastClickX) local dy = math.abs(input.Position.Y - lastClickY) if dx > USER_DIST_THRESH or dy > USER_DIST_THRESH then userActiveUntil = tick() + USER_PAUSE_TIME end end end) local function clickAt(cx, cy) lastClickX, lastClickY = cx, cy VIM:SendMouseButtonEvent(cx, cy, 0, true, game, 0) VIM:SendMouseButtonEvent(cx, cy, 0, false, game, 0) stats.clicks = stats.clicks + 1 end local function clickButton(btn) if not btn or not btn.Parent then return false end local pos, sz = btn.AbsolutePosition, btn.AbsoluteSize if sz.X == 0 then return false end clickAt(pos.X + sz.X/2, pos.Y + sz.Y/2 + GS:GetGuiInset().Y) return true end local function isStillValid(btn) return btn and btn.Parent and btn.Visible and btn.AbsoluteSize.X > 0 end local function userIsActive() return tick() < userActiveUntil end local function isVisibleFast(obj, cache) if cache[obj] ~= nil then return cache[obj] end if not obj:IsA("GuiObject") then cache[obj] = true; return true end if not obj.Visible then cache[obj] = false; return false end local pv = isVisibleFast(obj.Parent, cache) cache[obj] = pv return pv end local function scanGui() local s = { onStoryScreen=false, inBattle=false } local sa, pa = 0, 0 local vis = {} for _, o in ipairs(PG:GetDescendants()) do local cls = o.ClassName if (cls=="TextLabel" or cls=="TextButton" or cls=="ImageButton") and isVisibleFast(o, vis) then local txt = (cls=="TextLabel" or cls=="TextButton") and string.lower(o.Text or "") or "" local isBtn = cls=="TextButton" or cls=="ImageButton" if isBtn then for _, c in ipairs(o:GetChildren()) do if c:IsA("TextLabel") or c:IsA("TextButton") then txt = txt.." "..string.lower(c.Text or "") end end end if string.find(txt, "active modifiers", 1, true) then s.onStoryScreen = true end if isBtn and o.AbsoluteSize.X > 0 then local area = o.AbsoluteSize.X * o.AbsoluteSize.Y if string.find(txt, "basic attack", 1, true) then s.inBattle = true end if not s.lightStrike and string.find(txt, "light strike", 1, true) and not string.find(txt, "light slip", 1, true) and #txt < 30 then s.lightStrike = o end if string.find(txt, "story:", 1, true) and area > sa then s.storyMission, sa = o, area end if string.find(txt, "prestige", 1, true) and #txt < 20 and area > pa then s.prestige, pa = o, area end if not s.confirm and (string.find(txt, "confirm", 1, true) or (string.find(txt, "yes", 1, true) and #txt < 10)) then s.confirm = o end end end end return s end -- =========== GUI PANEL =========== local panel = Instance.new("ScreenGui") panel.Name = "AutoPrestigePanel"; panel.ResetOnSpawn = false panel.ZIndexBehavior = Enum.ZIndexBehavior.Sibling; panel.Parent = LP.PlayerGui local frame = Instance.new("Frame", panel) frame.Size = UDim2.new(0, 220, 0, 195) frame.Position = UDim2.new(0, 20, 0.4, 0) frame.BackgroundColor3 = Color3.fromRGB(20, 20, 30) frame.BackgroundTransparency = 0.15 frame.Active = true; frame.Draggable = true; frame.BorderSizePixel = 0 Instance.new("UICorner", frame).CornerRadius = UDim.new(0, 8) local stroke = Instance.new("UIStroke", frame); stroke.Color = Color3.fromRGB(255, 200, 50); stroke.Thickness = 1.5 local title = Instance.new("TextLabel", frame) title.Size = UDim2.new(1, 0, 0, 24); title.BackgroundTransparency = 1 title.Text = "AUTO PRESTIGE v10"; title.TextColor3 = Color3.fromRGB(255, 200, 50) title.Font = Enum.Font.GothamBold; title.TextSize = 14 local statusLbl = Instance.new("TextLabel", frame) statusLbl.Size = UDim2.new(1, -10, 0, 18); statusLbl.Position = UDim2.new(0, 5, 0, 26) statusLbl.BackgroundTransparency = 1; statusLbl.Font = Enum.Font.Gotham statusLbl.TextSize = 12; statusLbl.TextXAlignment = Enum.TextXAlignment.Left local statsLbl = Instance.new("TextLabel", frame) statsLbl.Size = UDim2.new(1, -10, 0, 100); statsLbl.Position = UDim2.new(0, 5, 0, 46) statsLbl.BackgroundTransparency = 1; statsLbl.TextColor3 = Color3.fromRGB(220, 220, 220) statsLbl.Font = Enum.Font.Code; statsLbl.TextSize = 12 statsLbl.TextXAlignment = Enum.TextXAlignment.Left statsLbl.TextYAlignment = Enum.TextYAlignment.Top local function makeBtn(text, color, posX) local b = Instance.new("TextButton", frame) b.Size = UDim2.new(0, 95, 0, 28) b.Position = UDim2.new(0, posX, 1, -36); b.BackgroundColor3 = color b.Text = text; b.TextColor3 = Color3.new(1,1,1) b.Font = Enum.Font.GothamBold; b.TextSize = 12; b.BorderSizePixel = 0 Instance.new("UICorner", b).CornerRadius = UDim.new(0, 6) return b end local pauseBtn = makeBtn("PAUSE", Color3.fromRGB(80, 80, 160), 10) local stopBtn = makeBtn("STOP", Color3.fromRGB(180, 50, 60), 115) pauseBtn.MouseButton1Click:Connect(function() getgenv().AutoPrestigePaused = not getgenv().AutoPrestigePaused end) stopBtn.MouseButton1Click:Connect(function() getgenv().AutoPrestigeRunning = false end) task.spawn(function() while getgenv().AutoPrestigeRunning do local elapsed = tick() - stats.startTime local h = math.floor(elapsed/3600) local m = math.floor((elapsed%3600)/60) local sec = math.floor(elapsed%60) local cps = stats.clicks / math.max(elapsed, 1) local statusText if getgenv().AutoPrestigePaused then statusText = "PAUSED" elseif userIsActive() then statusText = "User active" else statusText = stats.status end statusLbl.Text = "Status: " .. statusText statusLbl.TextColor3 = (getgenv().AutoPrestigePaused or userIsActive()) and Color3.fromRGB(255, 180, 80) or Color3.fromRGB(150, 255, 150) statsLbl.Text = string.format( "Time: %02d:%02d:%02d\nBattles: %d\nPrestiges: %d\nClicks: %d\nCPS: %.1f\nRecoveries: %d", h, m, sec, stats.battles, stats.prestiges, stats.clicks, cps, stats.stuckRecoveries) pauseBtn.Text = getgenv().AutoPrestigePaused and "RESUME" or "PAUSE" task.wait(0.25) end if panel then panel:Destroy() end end) local function attemptRecovery() stats.status = "Recovering" stats.stuckRecoveries = stats.stuckRecoveries + 1 warn("[AutoPrestige] Stuck for "..STUCK_TIMEOUT.."s - recovering") sendWebhook("**Bot stuck for "..STUCK_TIMEOUT.."s** - attempting recovery (#"..stats.stuckRecoveries..")") VIM:SendKeyEvent(true, Enum.KeyCode.Escape, false, game) task.wait(0.05) VIM:SendKeyEvent(false, Enum.KeyCode.Escape, false, game) task.wait(0.5) lastProgress = tick() end local cachedState, cachedLS, lastScan = nil, nil, 0 local function getState(force) if force or not cachedState or (tick() - lastScan) > SCAN_RATE then cachedState = scanGui() lastScan = tick() if cachedState.lightStrike then cachedLS = cachedState.lightStrike elseif not isStillValid(cachedLS) then cachedLS = nil end end return cachedState end print("[AutoPrestige v10] Started - smart pause + stuck detection") task.spawn(function() local wasInBattle = false while getgenv().AutoPrestigeRunning do if tick() - lastProgress > STUCK_TIMEOUT and not getgenv().AutoPrestigePaused then attemptRecovery() cachedState = nil end if getgenv().AutoPrestigePaused then stats.status = "Paused"; task.wait(0.3) elseif userIsActive() then stats.status = "User active"; task.wait(0.2) else local s = getState() if not s.onStoryScreen then stats.status = "Off-tab"; task.wait(0.4) elseif s.prestige and not s.inBattle then stats.status = "Prestige" clickButton(s.prestige) stats.prestiges = stats.prestiges + 1 lastProgress = tick() sendWebhook("**PRESTIGE #" .. stats.prestiges .. "** triggered") task.wait(POST_PRESTIGE) local s2 = getState(true) if s2.confirm then clickButton(s2.confirm) task.wait(POST_CONFIRM) end cachedState = nil elseif s.inBattle then wasInBattle = true stats.status = "Fighting" local btn = cachedLS or s.lightStrike if btn and isStillValid(btn) then cachedLS = btn local pos, sz = btn.AbsolutePosition, btn.AbsoluteSize local cx = pos.X + sz.X/2 local cy = pos.Y + sz.Y/2 + GS:GetGuiInset().Y local i = 0 while getgenv().AutoPrestigeRunning and not getgenv().AutoPrestigePaused and not userIsActive() do clickAt(cx, cy) lastProgress = tick() i = i + 1 if i % 8 == 0 and not isStillValid(btn) then break end if i > 200 then break end task.wait(CLICK_RATE) end cachedState = nil else cachedState = nil; task.wait(0.05) end elseif s.storyMission then if wasInBattle then stats.battles = stats.battles + 1 wasInBattle = false end stats.status = "Next mission" clickButton(s.storyMission) lastProgress = tick() task.wait(MENU_RATE) cachedState = nil else stats.status = "Waiting" task.wait(0.1) end end end if hotkeyConn then hotkeyConn:Disconnect() end if userInputConn then userInputConn:Disconnect() end warn("[AutoPrestige v10] Stopped.") end)