SALENDRA

Auto press reconnect

Oct 31st, 2025
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.67 KB | None | 0 0
  1. -- Sebs Auto Reconnect Clicker (Executor-ready)
  2. -- Auto klik tombol Reconnect / Retry / Try Again di CoreGui
  3. if getgenv().Sebs_AutoReconnect_Active then
  4. warn("[Sebs AutoReconnect] Sudah aktif.")
  5. return
  6. end
  7. getgenv().Sebs_AutoReconnect_Active = true
  8. local CoreGui = game:GetService("CoreGui")
  9. local UserInputService = game:GetService("UserInputService")
  10. local RunService = game:GetService("RunService")
  11. local running = true
  12. -- daftar kata kunci tombol reconnect (case-insensitive)
  13. local KEYWORDS = {
  14. "reconnect",
  15. "retry",
  16. "try again",
  17. "join",
  18. "continue",
  19. "re-join",
  20. "rejoin",
  21. "ok"
  22. }
  23. -- helper: apakah teks mengandung kata kunci reconnect
  24. local function isReconnectText(txt)
  25. if not txt or txt == "" then return false end
  26. txt = tostring(txt):lower()
  27. for _,kw in ipairs(KEYWORDS) do
  28. if string.find(txt, kw, 1, true) then
  29. return true
  30. end
  31. end
  32. return false
  33. end
  34. -- coba klik tombol dengan beberapa metode
  35. local function clickGuiButton(btn)
  36. if not btn or not btn.Parent then return false end
  37. local success = false
  38. -- :Activate()
  39. pcall(function()
  40. if btn.Activate then
  41. btn:Activate()
  42. success = true
  43. end
  44. end)
  45. if success then return true end
  46. -- Fire MouseButton1Click
  47. pcall(function()
  48. if btn.MouseButton1Click then
  49. btn.MouseButton1Click:Fire()
  50. success = true
  51. end
  52. end)
  53. if success then return true end
  54. -- VirtualUser fallback (if available)
  55. pcall(function()
  56. local ok, vu = pcall(function() return game:GetService("VirtualUser") end)
  57. if ok and vu then
  58. vu:CaptureController()
  59. -- try clicking at center of button absolute position if available
  60. local absX, absY = 0, 0
  61. if btn.AbsolutePosition and btn.AbsoluteSize then
  62. absX = btn.AbsolutePosition.X + btn.AbsoluteSize.X/2
  63. absY = btn.AbsolutePosition.Y + btn.AbsoluteSize.Y/2
  64. end
  65. pcall(function() vu:ClickButton1(Vector2.new(absX, absY)) end)
  66. pcall(function() vu:ClickButton2(Vector2.new(absX, absY)) end)
  67. success = true
  68. end
  69. end)
  70. return success
  71. end
  72. -- scan satu container untuk tombol reconnect
  73. local function scanContainerForReconnect(container)
  74. if not container then return false end
  75. for _,obj in ipairs(container:GetDescendants()) do
  76. if obj:IsA("TextButton") or obj:IsA("ImageButton") or obj:IsA("TextLabel") or obj:IsA("TextBox") then
  77. local text = nil
  78. -- beberapa UI tidak punya .Text (ImageButton) but might have child TextLabel
  79. pcall(function() text = obj.Text end)
  80. if isReconnectText(text) then
  81. -- if it's a label, try find a nearby button (parent or siblings)
  82. if obj:IsA("TextLabel") or obj:IsA("TextBox") then
  83. -- try parent children for actual button
  84. local parent = obj.Parent
  85. if parent then
  86. for _,c in ipairs(parent:GetChildren()) do
  87. if (c:IsA("TextButton") or c:IsA("ImageButton")) and clickGuiButton(c) then
  88. return true
  89. end
  90. end
  91. end
  92. else
  93. if clickGuiButton(obj) then
  94. return true
  95. end
  96. end
  97. end
  98. end
  99. end
  100. return false
  101. end
  102. -- full scan CoreGui (safest)
  103. local function scanCoreGui()
  104. local ok, children = pcall(function() return CoreGui:GetChildren() end)
  105. if not ok then return false end
  106. for _,child in ipairs(children) do
  107. if child and child:IsA("ScreenGui") or child:IsA("GuiMain") then
  108. if scanContainerForReconnect(child) then
  109. return true
  110. end
  111. else
  112. -- also check descendants of non-ScreenGui (some executors use different types)
  113. if pcall(function() return child:GetDescendants() end) then
  114. if scanContainerForReconnect(child) then
  115. return true
  116. end
  117. end
  118. end
  119. end
  120. return false
  121. end
  122. -- listener: ketika GUI baru muncul di CoreGui
  123. local function setupCoreGuiListener()
  124. pcall(function()
  125. CoreGui.ChildAdded:Connect(function(child)
  126. if not running then return end
  127. -- sedikit delay supaya teks tombol ter-setup
  128. task.wait(0.1)
  129. -- scan the newly added child
  130. pcall(function()
  131. if scanContainerForReconnect(child) then
  132. print("[Sebs AutoReconnect] Tombol reconnect terdeteksi dan ditekan (ChildAdded).")
  133. end
  134. end)
  135. end)
  136. end)
  137. end
  138. -- periodic scan fallback (mis. jika GUI sudah ada sebelum listener)
  139. local function setupPeriodicScanner()
  140. task.spawn(function()
  141. while running do
  142. local ok, pressed = pcall(scanCoreGui)
  143. if ok and pressed then
  144. print("[Sebs AutoReconnect] Tombol reconnect ditemukan & diklik (periodic scan).")
  145. end
  146. task.wait(1) -- scan setiap 1 detik (aman)
  147. end
  148. end)
  149. end
  150. -- expose stop function
  151. getgenv().Sebs_AutoReconnect_Stop = function()
  152. running = false
  153. getgenv().Sebs_AutoReconnect_Active = nil
  154. print("[Sebs AutoReconnect] Dihentikan.")
  155. end
  156. -- init
  157. setupCoreGuiListener()
  158. setupPeriodicScanner()
  159. print("[Sebs AutoReconnect] Aktif — otomatis menekan tombol reconnect/retry jika muncul.")
  160.  
Advertisement
Add Comment
Please, Sign In to add comment