Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Sebs Auto Reconnect Clicker (Executor-ready)
- -- Auto klik tombol Reconnect / Retry / Try Again di CoreGui
- if getgenv().Sebs_AutoReconnect_Active then
- warn("[Sebs AutoReconnect] Sudah aktif.")
- return
- end
- getgenv().Sebs_AutoReconnect_Active = true
- local CoreGui = game:GetService("CoreGui")
- local UserInputService = game:GetService("UserInputService")
- local RunService = game:GetService("RunService")
- local running = true
- -- daftar kata kunci tombol reconnect (case-insensitive)
- local KEYWORDS = {
- "reconnect",
- "retry",
- "try again",
- "join",
- "continue",
- "re-join",
- "rejoin",
- "ok"
- }
- -- helper: apakah teks mengandung kata kunci reconnect
- local function isReconnectText(txt)
- if not txt or txt == "" then return false end
- txt = tostring(txt):lower()
- for _,kw in ipairs(KEYWORDS) do
- if string.find(txt, kw, 1, true) then
- return true
- end
- end
- return false
- end
- -- coba klik tombol dengan beberapa metode
- local function clickGuiButton(btn)
- if not btn or not btn.Parent then return false end
- local success = false
- -- :Activate()
- pcall(function()
- if btn.Activate then
- btn:Activate()
- success = true
- end
- end)
- if success then return true end
- -- Fire MouseButton1Click
- pcall(function()
- if btn.MouseButton1Click then
- btn.MouseButton1Click:Fire()
- success = true
- end
- end)
- if success then return true end
- -- VirtualUser fallback (if available)
- pcall(function()
- local ok, vu = pcall(function() return game:GetService("VirtualUser") end)
- if ok and vu then
- vu:CaptureController()
- -- try clicking at center of button absolute position if available
- local absX, absY = 0, 0
- if btn.AbsolutePosition and btn.AbsoluteSize then
- absX = btn.AbsolutePosition.X + btn.AbsoluteSize.X/2
- absY = btn.AbsolutePosition.Y + btn.AbsoluteSize.Y/2
- end
- pcall(function() vu:ClickButton1(Vector2.new(absX, absY)) end)
- pcall(function() vu:ClickButton2(Vector2.new(absX, absY)) end)
- success = true
- end
- end)
- return success
- end
- -- scan satu container untuk tombol reconnect
- local function scanContainerForReconnect(container)
- if not container then return false end
- for _,obj in ipairs(container:GetDescendants()) do
- if obj:IsA("TextButton") or obj:IsA("ImageButton") or obj:IsA("TextLabel") or obj:IsA("TextBox") then
- local text = nil
- -- beberapa UI tidak punya .Text (ImageButton) but might have child TextLabel
- pcall(function() text = obj.Text end)
- if isReconnectText(text) then
- -- if it's a label, try find a nearby button (parent or siblings)
- if obj:IsA("TextLabel") or obj:IsA("TextBox") then
- -- try parent children for actual button
- local parent = obj.Parent
- if parent then
- for _,c in ipairs(parent:GetChildren()) do
- if (c:IsA("TextButton") or c:IsA("ImageButton")) and clickGuiButton(c) then
- return true
- end
- end
- end
- else
- if clickGuiButton(obj) then
- return true
- end
- end
- end
- end
- end
- return false
- end
- -- full scan CoreGui (safest)
- local function scanCoreGui()
- local ok, children = pcall(function() return CoreGui:GetChildren() end)
- if not ok then return false end
- for _,child in ipairs(children) do
- if child and child:IsA("ScreenGui") or child:IsA("GuiMain") then
- if scanContainerForReconnect(child) then
- return true
- end
- else
- -- also check descendants of non-ScreenGui (some executors use different types)
- if pcall(function() return child:GetDescendants() end) then
- if scanContainerForReconnect(child) then
- return true
- end
- end
- end
- end
- return false
- end
- -- listener: ketika GUI baru muncul di CoreGui
- local function setupCoreGuiListener()
- pcall(function()
- CoreGui.ChildAdded:Connect(function(child)
- if not running then return end
- -- sedikit delay supaya teks tombol ter-setup
- task.wait(0.1)
- -- scan the newly added child
- pcall(function()
- if scanContainerForReconnect(child) then
- print("[Sebs AutoReconnect] Tombol reconnect terdeteksi dan ditekan (ChildAdded).")
- end
- end)
- end)
- end)
- end
- -- periodic scan fallback (mis. jika GUI sudah ada sebelum listener)
- local function setupPeriodicScanner()
- task.spawn(function()
- while running do
- local ok, pressed = pcall(scanCoreGui)
- if ok and pressed then
- print("[Sebs AutoReconnect] Tombol reconnect ditemukan & diklik (periodic scan).")
- end
- task.wait(1) -- scan setiap 1 detik (aman)
- end
- end)
- end
- -- expose stop function
- getgenv().Sebs_AutoReconnect_Stop = function()
- running = false
- getgenv().Sebs_AutoReconnect_Active = nil
- print("[Sebs AutoReconnect] Dihentikan.")
- end
- -- init
- setupCoreGuiListener()
- setupPeriodicScanner()
- print("[Sebs AutoReconnect] Aktif — otomatis menekan tombol reconnect/retry jika muncul.")
Advertisement
Add Comment
Please, Sign In to add comment