ustinjamesss

Auto rob

Mar 13th, 2023
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.67 KB | None | 0 0
  1. --[[
  2. ERLC AutoSolver
  3. Last updated: 20 / 11 / 2022 ( or 11 / 20 / 2022 in freedom time )
  4.  
  5. Made by TheSynapseGuy on V3rmillion
  6. Supported Robberies
  7. - Lockpick
  8. - Drill
  9. - ATM Hack
  10. - Safe ( Sometimes work, can't test it that much because of how rare it is to get a Safe when robbing a house )
  11.  
  12. Please do not modify this script without my permission, or redistribute it without any credit to me.
  13. ]]
  14.  
  15. -- Do not touch the code below this line
  16. local Players = game:GetService("Players"); local LocalPlayer = Players.LocalPlayer; local ReplicatedStorage = game:GetService("ReplicatedStorage"); local RunService = game:GetService("RunService");
  17. rconsolename("ERLC AutoSolver | TheSynapseGuy | V3rmillion")
  18. local ColorIndex = {BLACK = 30,RED = 31,GREEN = 32,YELLOW = 33,BLUE = 34,MAGENTA = 35,CYAN = 36,LIGHT_GRAY = 37,DARK_GRAY = 90,LIGHT_RED = 91,LIGHT_GREEN = 92,LIGHT_YELLOW = 93,LIGHT_BLUE = 94,LIGHT_MAGENTA = 95, LIGHT_CYAN = 96, WHITE = 97, B = 1, UNDERLINE = 4, N_UNDERLINE = 24, NEGATIVE = 7, POSITIVE = 27, DEFAULT = 0}
  19. local function rcolorprint( message ) local SeperatedContents = string.split(message, "@@") for i, v in pairs(SeperatedContents) do if i % 2 == 0 then rconsoleprint("\27["..ColorIndex[string.upper(v)].."m") else rconsoleprint(v) end end end
  20. local logging = {}
  21. logging.info = function( message ) rcolorprint("@@LIGHT_GRAY@@[@@BLUE@@INFO@@LIGHT_GRAY@@] @@WHITE@@"..message.."\n") end
  22. logging.warn = function( message ) rcolorprint("@@LIGHT_GRAY@@[@@YELLOW@@WARN@@LIGHT_GRAY@@] @@WHITE@@"..message.."\n") end
  23. logging.error = function( message ) rcolorprint("@@LIGHT_GRAY@@[@@RED@@FAIL@@LIGHT_GRAY@@] @@WHITE@@"..message.."\n") end
  24.  
  25. logging.info("ERLC AutoSolver made by TheSynapseGuy on V3rm")
  26. logging.warn("This is a simple script that will finish the robbery puzzles for you. This was last updated on @@B@@@@BLUE@@20/11/2022@@DEFAULT@@")
  27. logging.info("Always keep your cursor inside the window when using this script. If you don't, the script will not work.")
  28. logging.info("If you have any issues, please contact me on V3rm @@RED@@ONLY@@DEFAULT@@ if this script has been updated in the past month.")
  29. local function hookgamemenu(child)
  30. local success, message = pcall(function()
  31. if child.Name == "GameMenus" and child:IsA("ScreenGui") then
  32. logging.info("Hooked onto GameMenu")
  33. local GameMenu = child
  34. local HackingUI = GameMenu:WaitForChild("ATM"):WaitForChild("Hacking")
  35. local LockpickUI = GameMenu:WaitForChild("Lockpick")
  36. local RobJewelryUI = GameMenu:WaitForChild("RobJewelry")
  37. local SafeUI = GameMenu:WaitForChild("Safe")
  38.  
  39. local CycleFrame = HackingUI:WaitForChild("CycleFrame")
  40. local SelectingCodeTextLabel = HackingUI:WaitForChild("SelectingCode")
  41.  
  42. local function MoveCursorToCenter()
  43. local ScreenSize = GameMenu.AbsoluteSize
  44. local X = math.floor(ScreenSize.X / 2)
  45. local Y = math.floor(ScreenSize.Y / 2)
  46.  
  47. mousemoveabs(X,Y)
  48. end
  49. -- Listen for ATM hack start
  50. CycleFrame.DescendantAdded:Connect(function( NewDescendant )
  51. local success, message = pcall(function()
  52. if NewDescendant:IsA("TextLabel") then
  53. NewDescendant:GetPropertyChangedSignal("BackgroundColor3"):Connect(function()
  54. if NewDescendant.Text == SelectingCodeTextLabel.Text and NewDescendant.BackgroundColor3 ~= Color3.fromRGB(0,0,0) then
  55. logging.info("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@ATM@@LIGHT_GRAY@@] @@WHITE@@Found matching code: @@MAGENTA@@"..NewDescendant.Text)
  56. MoveCursorToCenter()
  57. mouse1click()
  58. end
  59. end)
  60. end
  61. end)
  62. if not success then
  63. logging.error("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@ATM@@LIGHT_GRAY@@] @@WHITE@@Error occured while hooking onto ATM label: @@RED@@"..message)
  64. end
  65. end)
  66. -- Listen for new Lockpick UI
  67. LockpickUI.ChildAdded:Connect(function(child)
  68. local success, message = pcall(function()
  69. if child:IsA("Frame") and child.Name == "Pick" then
  70. local LockNumber = 1
  71. task.wait(0.2)
  72. logging.info("@@LIGHT_GRAY@@[@@LIGHT_RED@@LOCKPICK@@LIGHT_GRAY@@] @@WHITE@@Detected Lockpick robbery, keep cursor in window.")
  73. local StartTime = tick()
  74. while true do
  75. local TargetLock = child:WaitForChild(tostring(LockNumber))
  76. local Half = TargetLock.Size.Y.Scale / 2
  77.  
  78. local LockPositionY = TargetLock.Position.Y.Scale
  79. if math.abs(LockPositionY - 0.5) <= ( Half - 0.01 ) then
  80. mouse1click()
  81. logging.info("@@LIGHT_GRAY@@[@@LIGHT_RED@@LOCKPICK@@LIGHT_GRAY@@] @@WHITE@@Pin @@LIGHT_GRAY@@[@@LIGHT_GREEN@@"..tostring(LockNumber).."@@LIGHT_GRAY@@] @@WHITE@@finished, diff @@LIGHT_GRAY@@[@@LIGHT_MAGENTA@@"..tostring(math.abs(LockPositionY - 0.5)).."@@LIGHT_GRAY@@] @@WHITE@@min @@LIGHT_GRAY@@[@@LIGHT_CYAN@@"..tostring(Half - 0.01).."@@LIGHT_GRAY@@] @@WHITE@@")
  82. if LockNumber >= 6 then
  83. logging.info("@@LIGHT_GRAY@@[@@LIGHT_RED@@LOCKPICK@@LIGHT_GRAY@@] @@WHITE@@Finished Lockpick robbery in @@CYAN@@"..tostring(tick() - StartTime).." @@WHITE@@seconds")
  84. break
  85. end
  86. LockNumber += 1
  87. end
  88.  
  89. task.wait(0.0005)
  90. end
  91. end
  92. end)
  93. if not success then
  94. logging.error("@@LIGHT_GRAY@@[@@LIGHT_RED@@LOCKPICK@@LIGHT_GRAY@@] @@WHITE@@Error occured while doing Lockpick: @@RED@@"..message)
  95. end
  96. end)
  97. -- Listening for drill
  98. RobJewelryUI.ChildAdded:Connect(function( child )
  99. local success, message = pcall(function()
  100. if child.Name == "Drill" and child:IsA("Frame") then
  101. -- Start drilling
  102. logging.info("@@LIGHT_GRAY@@[@@LIGHT_BLUE@@DRILL@@LIGHT_GRAY@@] @@WHITE@@Jewellery robbery detected waiting for user to start drilling")
  103. repeat RunService.RenderStepped:Wait() until child.Bar.Position ~= UDim2.new(0.5,-2,0,0)
  104. -- Keep bar in center until frame disappears
  105. logging.info("@@LIGHT_GRAY@@[@@LIGHT_BLUE@@DRILL@@LIGHT_GRAY@@] @@WHITE@@Starting, keep cursor in window")
  106. repeat
  107. if child.Bar.Position.X.Scale < 0.5 then
  108. mouse1press()
  109. repeat
  110. task.wait(0.0005)
  111. until child.Bar.Position.X.Scale > 0.5
  112. mouse1release()
  113. end
  114. task.wait(0.0005)
  115. until RobJewelryUI.Position ~= UDim2.new(0.5, 0, 0.5, 0)
  116. logging.info("@@LIGHT_GRAY@@[@@LIGHT_BLUE@@DRILL@@LIGHT_GRAY@@] @@WHITE@@Jewellery robbery finished")
  117. end
  118. end)
  119. if not success then
  120. logging.error("@@LIGHT_GRAY@@[@@LIGHT_BLUE@@DRILL@@LIGHT_GRAY@@] @@WHITE@@Error occured while doing Jewellry robbery: @@RED@@"..message)
  121. end
  122. end)
  123. -- Listening for safe
  124. SafeUI.ChildAdded:Connect(function( child )
  125. local success, message = pcall(function()
  126. if child:IsA("Frame") and child.Name == "Safe" then
  127. logging.info("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@SAFE@@LIGHT_GRAY@@] @@WHITE@@Safe robbery detected, starting")
  128. local StartTime = tick()
  129. -- Listen for dial rotation
  130. task.wait(2)
  131. repeat
  132. local success, message = pcall(function()
  133. local Rotation = child.Dial.Rotation
  134. local TargetNumber = tonumber(SafeUI["Top2"]["TargetNum"].Text)
  135.  
  136. local CurrentNumber = (math.abs(Rotation) % 360)/36*10
  137. if Rotation > 0 then
  138. CurrentNumber = 100 - CurrentNumber
  139. end
  140. if math.abs(CurrentNumber - TargetNumber) <= 1 then
  141. MoveCursorToCenter()
  142. mouse1click()
  143. logging.info("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@SAFE@@LIGHT_GRAY@@] @@WHITE@@Cracked safe number landed at @@LIGHT_GRAY@@[@@GREEN@@"..tostring(CurrentNumber).."@@LIGHT_GRAY@@] @@WHITE@@target @@LIGHT_GRAY@@[@@GREEN@@"..tostring(TargetNumber).."@@LIGHT_GRAY@@]@@WHITE@@ raw rotation @@LIGHT_GRAY@@[@@GREEN@@"..tostring(Rotation).."@@LIGHT_GRAY@@]@@WHITE@@")
  144. task.wait(1)
  145. end
  146. end)
  147. if not success then
  148. logging.error("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@SAFE@@LIGHT_GRAY@@] @@WHITE@@Error occured while doing Safe robbery: @@RED@@"..message)
  149. end
  150. task.wait(0.0005)
  151. until SafeUI.Position ~= UDim2.new(0.5, 0, 0.5, 0)
  152. logging.info("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@SAFE@@LIGHT_GRAY@@] @@WHITE@@Completed safe robbery in @@CYAN@@"..tostring(tick() - StartTime).." @@WHITE@@seconds")
  153. end
  154. end)
  155. if not success then
  156. logging.error("@@LIGHT_GRAY@@[@@LIGHT_GREEN@@SAFE@@LIGHT_GRAY@@] @@WHITE@@Error occured while doing Safe robbery: @@RED@@"..message)
  157. end
  158. end)
  159. end
  160. end)
  161. if not success then
  162. logging.error("Error occured while hooking onto gamemenu: @@RED@@"..message)
  163. end
  164. end
  165. hookgamemenu(LocalPlayer:WaitForChild("PlayerGui"):WaitForChild("GameMenus"))
  166. LocalPlayer:WaitForChild("PlayerGui").ChildAdded:Connect(hookgamemenu)
  167. logging.info("Waiting for robbery")
Add Comment
Please, Sign In to add comment