Guest User

Untitled

a guest
Apr 29th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 68.95 KB | None | 0 0
  1. #singleinstance, force
  2. #noenv
  3. #persistent
  4. SetWorkingDir, % A_ScriptDir "\lib"
  5. CoordMode, Pixel, Screen
  6. CoordMode, Mouse, Screen
  7.  
  8. if (RegExMatch(A_ScriptDir,"\.zip")){
  9. MsgBox, 0, % "Running From ZIP", % "You are attempting to run the script from a ZIP file.`n`nPlease Extract/Unzip the file first, then run the script in the extracted folder."
  10. ExitApp
  11. }
  12.  
  13. #Include %A_ScriptDir%\lib
  14. #Include ocr.ahk
  15. #Include Gdip_All.ahk
  16. #Include Gdip_ImageSearch.ahk
  17.  
  18. Gdip_Startup()
  19.  
  20. global version := "v1.3.5"
  21.  
  22. global robloxId := 0
  23.  
  24. global canStart := 0
  25. global macroStarted := 0
  26. global reconnecting := 0
  27.  
  28. global isSpawnCentered := 0
  29. global atSpawn := 0
  30.  
  31. global pathsRunning := []
  32.  
  33. obbyCooldown := 120 ; 120 seconds
  34. lastObby := A_TickCount - obbyCooldown*1000
  35. hasObbyBuff := 0
  36.  
  37. obbyStatusEffectColor := 0x9CFFAC
  38.  
  39. statusEffectSpace := 5
  40.  
  41. global mainDir := A_ScriptDir "\"
  42.  
  43. configPath := mainDir . "settings\config.ini"
  44. global ssPath := "ss.jpg"
  45. global pathDir := mainDir . "paths\"
  46. global imgDir := mainDir . "images\"
  47.  
  48. configHeader := "; dolphSol Settings`n; Do not put spaces between equals`n; Additions may break this file and the macro overall, please be cautious`n; If you mess up this file, clear it entirely and restart the macro`n`n[Options]`r`n"
  49.  
  50. global potionIndex := {0:"None"
  51. ,1:"Fortune Potion I"
  52. ,2:"Fortune Potion II"
  53. ,3:"Fortune Potion III"
  54. ,4:"Haste Potion I"
  55. ,5:"Haste Potion II"
  56. ,6:"Heavenly Potion I"
  57. ,7:"Heavenly Potion II"
  58. ,8:"Universe Potion I"}
  59.  
  60.  
  61. global craftingInfo := {"Gilded Coin":{slot:13,addSlots:1,maxes:[1],attempts:5,addedAttempts:1}
  62. ,"Fortune Potion I":{slot:1,subSlot:1,addSlots:4,maxes:[5,1,5,1],attempts:2}
  63. ,"Fortune Potion II":{slot:1,subSlot:2,addSlots:5,maxes:[1,10,5,10,2],attempts:2}
  64. ,"Fortune Potion III":{slot:1,subSlot:3,addSlots:5,maxes:[1,15,10,15,5],attempts:2}
  65. ,"Haste Potion I":{slot:2,subSlot:1,addSlots:4,maxes:[10,5,10,1],attempts:2}
  66. ,"Haste Potion II":{slot:2,subSlot:2,addSlots:5,maxes:[1,10,10,15,2],attempts:2}
  67. ,"Heavenly Potion I":{slot:3,subSlot:1,addSlots:4,maxes:[100,50,20,1],attempts:2}
  68. ,"Heavenly Potion II":{slot:3,subSlot:2,addSlots:5,maxes:[2,125,75,50,1],attempts:2}
  69. ,"Universe Potion I":{slot:4,subSlot:1,addSlots:3,maxes:[10,15,2],attempts:2}}
  70.  
  71. global rarityIndex := {0:"None"
  72. ,1:"1/1k+"
  73. ,2:"1/10k+"
  74. ,3:"1/100k+"}
  75.  
  76. reverseIndices(t){
  77. newT := {}
  78. for i,v in t {
  79. newT[v] := i
  80. }
  81. return newT
  82. }
  83.  
  84. global reversePotionIndex := reverseIndices(potionIndex)
  85. global reverseRarityIndex := reverseIndices(rarityIndex)
  86.  
  87. ; defaults
  88. global options := {"DoingObby":1
  89. ,"AzertyLayout":0
  90. ,"ArcanePath":0
  91. ,"CheckObbyBuff":1
  92. ,"CollectItems":1
  93. ,"ItemSpot1":1
  94. ,"ItemSpot2":1
  95. ,"ItemSpot3":1
  96. ,"ItemSpot4":1
  97. ,"ItemSpot5":1
  98. ,"ItemSpot6":1
  99. ,"ItemSpot7":1
  100. ,"Screenshotinterval":60
  101. ,"WindowX":100
  102. ,"WindowY":100
  103. ,"VIP":0
  104. ,"BackOffset":0
  105. ,"ReconnectEnabled":1
  106. ,"AutoEquipEnabled":0
  107. ,"AutoEquipX":-0.415
  108. ,"AutoEquipY":-0.438
  109. ,"PrivateServerId":""
  110. ,"WebhookEnabled":0
  111. ,"WebhookLink":""
  112. ,"WebhookImportantOnly":0
  113. ,"DiscordUserID":""
  114. ,"WebhookRollSendMinimum":10000
  115. ,"WebhookRollPingMinimum":100000
  116. ,"WebhookAuraRollImages":0
  117. ,"StatusBarEnabled":0
  118. ,"WasRunning":0
  119. ,"FirstTime":0
  120. ,"CraftingInterval":10
  121. ,"ItemCraftingEnabled":0
  122. ,"CraftingGildedCoin":1
  123. ,"PotionCraftingEnabled":0
  124. ,"PotionCraftingSlot1":0
  125. ,"PotionCraftingSlot2":0
  126. ,"PotionCraftingSlot3":0
  127. ,"LastCraftSession":0
  128. ,"InvScreenshotsEnabled":1
  129. ,"LastInvScreenshot":0
  130.  
  131. ,"ExtraRoblox":0 ; mainly for me (builderdolphin) to run my 3rd acc on 2nd monitor, not used for anything else, not intended for public use unless yk what you're doing i guess
  132.  
  133. ; not really options but stats i guess
  134. ,"RunTime":0
  135. ,"Disconnects":0
  136. ,"ObbyCompletes":0
  137. ,"ObbyAttempts":0
  138. ,"CollectionLoops":0}
  139.  
  140. global sData := {}
  141.  
  142. global privateServerPre := "https://www.roblox.com/games/15532962292/Sols-RNG?privateServerLinkCode="
  143.  
  144. getINIData(path){
  145. FileRead, retrieved, %path%
  146.  
  147. retrievedData := {}
  148. readingPoint := 0
  149.  
  150. if (!ErrorLevel){
  151. ls := StrSplit(retrieved,"`r`n")
  152. for i,v in ls {
  153. isHeader := RegExMatch(v,"\[(.*)]")
  154. if (v && readingPoint && !isHeader){
  155. RegExMatch(v,"(.*)(?==)",index)
  156. RegExMatch(v,"(?<==)(.*)",value)
  157. if (index){
  158. retrievedData[index] := value
  159. }
  160. } else if (isHeader){
  161. readingPoint := 1
  162. }
  163. }
  164. } else {
  165. MsgBox, An error occurred while reading %path% data, please review the file.
  166. return
  167. }
  168. return retrievedData
  169. }
  170.  
  171. writeToINI(path,object,header){
  172. if (!FileExist(path)){
  173. MsgBox, You are missing the file: %path%, please ensure that it is in the correct location.
  174. return
  175. }
  176.  
  177. formatted := header
  178.  
  179. for i,v in object {
  180. formatted .= i . "=" . v . "`r`n"
  181. }
  182.  
  183. FileDelete, %path%
  184. FileAppend, %formatted%, %path%
  185. }
  186.  
  187. ; data loading
  188. loadData(){
  189. global configPath
  190. savedRetrieve := getINIData(configPath)
  191. if (!savedRetrieve){
  192. MsgBox, Unable to retrieve config data, your settings have been set to their defaults.
  193. savedRetrieve := {}
  194. }
  195. newOptions := {}
  196. for i,v in options {
  197. if (savedRetrieve.HasKey(i)){
  198. newOptions[i] := savedRetrieve[i]
  199. } else {
  200. newOptions[i] := v
  201. }
  202. }
  203. options := newOptions
  204. }
  205. loadData()
  206.  
  207. saveOptions(){
  208. global configPath,configHeader
  209. writeToINI(configPath,options,configHeader)
  210. }
  211. saveOptions()
  212.  
  213. updateYesClicked(){
  214. Run % (sData.versionLink ? sData.versionLink : "https://github.com/BuilderDolphin/dolphSol-Macro/releases/latest")
  215. ExitApp
  216. }
  217.  
  218. updateStaticData(){
  219. url := "https://raw.githubusercontent.com/BuilderDolphin/dolphSol-Macro/main/lib/staticData.ini"
  220.  
  221. WinHttp := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  222. WinHttp.Open("GET", url, false)
  223. WinHttp.SetRequestHeader("Cache-Control", "no-cache")
  224. WinHttp.SetRequestHeader("Pragma", "no-cache")
  225. WinHttp.Send()
  226.  
  227. If (WinHttp.Status = 200) {
  228. content := WinHttp.ResponseText
  229. FileDelete, staticData.ini
  230. FileAppend, %content%, staticData.ini
  231. }
  232.  
  233. sData := getINIData("staticData.ini")
  234. if (sData.latestVersion != version){
  235. MsgBox, 4, % "New Update Available", % "A new update is available! Would you like to head to the GitHub page to update your macro?" . (sData.updateNotes ? ("`n`nUpdate Notes:`n" . sData.updateNotes) : "")
  236.  
  237. IfMsgBox Yes
  238. updateYesClicked()
  239. }
  240. }
  241. updateStaticData()
  242.  
  243. ; CreateFormData() by tmplinshi, AHK Topic: https://autohotkey.com/boards/viewtopic.php?t=7647
  244. ; Thanks to Coco: https://autohotkey.com/boards/viewtopic.php?p=41731#p41731
  245. ; Modified version by SKAN, 09/May/2016
  246.  
  247. CreateFormData(ByRef retData, ByRef retHeader, objParam) {
  248. New CreateFormData(retData, retHeader, objParam)
  249. }
  250.  
  251. Class CreateFormData {
  252.  
  253. __New(ByRef retData, ByRef retHeader, objParam) {
  254.  
  255. Local CRLF := "`r`n", i, k, v, str, pvData
  256. ; Create a random Boundary
  257. Local Boundary := this.RandomBoundary()
  258. Local BoundaryLine := "------------------------------" . Boundary
  259.  
  260. this.Len := 0 ; GMEM_ZEROINIT|GMEM_FIXED = 0x40
  261. this.Ptr := DllCall( "GlobalAlloc", "UInt",0x40, "UInt",1, "Ptr" ) ; allocate global memory
  262.  
  263. ; Loop input paramters
  264. For k, v in objParam
  265. {
  266. If IsObject(v) {
  267. For i, FileName in v
  268. {
  269. str := BoundaryLine . CRLF
  270. . "Content-Disposition: form-data; name=""" . k . """; filename=""" . FileName . """" . CRLF
  271. . "Content-Type: " . this.MimeType(FileName) . CRLF . CRLF
  272. this.StrPutUTF8( str )
  273. this.LoadFromFile( Filename )
  274. this.StrPutUTF8( CRLF )
  275. }
  276. } Else {
  277. str := BoundaryLine . CRLF
  278. . "Content-Disposition: form-data; name=""" . k """" . CRLF . CRLF
  279. . v . CRLF
  280. this.StrPutUTF8( str )
  281. }
  282. }
  283.  
  284. this.StrPutUTF8( BoundaryLine . "--" . CRLF )
  285.  
  286. ; Create a bytearray and copy data in to it.
  287. retData := ComObjArray( 0x11, this.Len ) ; Create SAFEARRAY = VT_ARRAY|VT_UI1
  288. pvData := NumGet( ComObjValue( retData ) + 8 + A_PtrSize )
  289. DllCall( "RtlMoveMemory", "Ptr",pvData, "Ptr",this.Ptr, "Ptr",this.Len )
  290.  
  291. this.Ptr := DllCall( "GlobalFree", "Ptr",this.Ptr, "Ptr" ) ; free global memory
  292.  
  293. retHeader := "multipart/form-data; boundary=----------------------------" . Boundary
  294. }
  295.  
  296. StrPutUTF8( str ) {
  297. Local ReqSz := StrPut( str, "utf-8" ) - 1
  298. this.Len += ReqSz ; GMEM_ZEROINIT|GMEM_MOVEABLE = 0x42
  299. this.Ptr := DllCall( "GlobalReAlloc", "Ptr",this.Ptr, "UInt",this.len + 1, "UInt", 0x42 )
  300. StrPut( str, this.Ptr + this.len - ReqSz, ReqSz, "utf-8" )
  301. }
  302.  
  303. LoadFromFile( Filename ) {
  304. Local objFile := FileOpen( FileName, "r" )
  305. this.Len += objFile.Length ; GMEM_ZEROINIT|GMEM_MOVEABLE = 0x42
  306. this.Ptr := DllCall( "GlobalReAlloc", "Ptr",this.Ptr, "UInt",this.len, "UInt", 0x42 )
  307. objFile.RawRead( this.Ptr + this.Len - objFile.length, objFile.length )
  308. objFile.Close()
  309. }
  310.  
  311. RandomBoundary() {
  312. str := "0|1|2|3|4|5|6|7|8|9|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z"
  313. Sort, str, D| Random
  314. str := StrReplace(str, "|")
  315. Return SubStr(str, 1, 12)
  316. }
  317.  
  318. MimeType(FileName) {
  319. n := FileOpen(FileName, "r").ReadUInt()
  320. Return (n = 0x474E5089) ? "image/png"
  321. : (n = 0x38464947) ? "image/gif"
  322. : (n&0xFFFF = 0x4D42 ) ? "image/bmp"
  323. : (n&0xFFFF = 0xD8FF ) ? "image/jpeg"
  324. : (n&0xFFFF = 0x4949 ) ? "image/tiff"
  325. : (n&0xFFFF = 0x4D4D ) ? "image/tiff"
  326. : "application/octet-stream"
  327. }
  328.  
  329. }
  330.  
  331. webhookPost(data := 0){
  332. data := data ? data : {}
  333.  
  334. url := options.webhookLink
  335.  
  336. if (data.pings){
  337. data.content := data.content ? data.content " <@" options.DiscordUserID ">" : "<@" options.DiscordUserID ">"
  338. }
  339.  
  340. payload_json := "
  341. (LTrim Join
  342. {
  343. ""content"": """ data.content """,
  344. ""embeds"": [{
  345. " (data.embedAuthor ? """author"": {""name"": """ data.embedAuthor """" (data.embedAuthorImage ? ",""icon_url"": """ data.embedAuthorImage """" : "") "}," : "") "
  346. " (data.embedTitle ? """title"": """ data.embedTitle """," : "") "
  347. ""description"": """ data.embedContent """,
  348. " (data.embedThumbnail ? """thumbnail"": {""url"": """ data.embedThumbnail """}," : "") "
  349. " (data.embedImage ? """image"": {""url"": """ data.embedImage """}," : "") "
  350. " (data.embedFooter ? """footer"": {""text"": """ data.embedFooter """}," : "") "
  351. ""color"": """ (data.embedColor ? data.embedColor : 0) """
  352. }]
  353. }
  354. )"
  355.  
  356. if ((!data.embedContent && !data.embedTitle) || data.noEmbed)
  357. payload_json := RegExReplace(payload_json, ",.*""embeds.*}]", "")
  358.  
  359.  
  360. objParam := {payload_json: payload_json}
  361.  
  362. for i,v in (data.files ? data.files : []) {
  363. objParam["file" i] := [v]
  364. }
  365.  
  366. CreateFormData(postdata,hdr_ContentType,objParam)
  367.  
  368. WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  369. WebRequest.Open("POST", url, true)
  370. WebRequest.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
  371. WebRequest.SetRequestHeader("Content-Type", hdr_ContentType)
  372. WebRequest.SetRequestHeader("Pragma", "no-cache")
  373. WebRequest.SetRequestHeader("Cache-Control", "no-cache, no-store")
  374. WebRequest.SetRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT")
  375. WebRequest.Send(postdata)
  376. WebRequest.WaitForResponse()
  377. }
  378.  
  379. HasVal(haystack, needle) {
  380. for index, value in haystack
  381. if (value = needle)
  382. return index
  383. if !(IsObject(haystack))
  384. throw Exception("Bad haystack!", -1, haystack)
  385. return 0
  386. }
  387.  
  388. global possibleDowns := ["w","a","s","d","Space","Enter","Esc","r"]
  389.  
  390. liftKeys(){
  391. for i,v in possibleDowns {
  392. Send {%v% Up}
  393. }
  394. }
  395.  
  396. stop(terminate := 0) {
  397. if (running){
  398. updateStatus("Macro Stopped")
  399. }
  400.  
  401. if (terminate){
  402. options.WasRunning := 0
  403. }
  404.  
  405. DetectHiddenWindows, On
  406. WinClose, % mainDir . "lib\status.ahk"
  407.  
  408. for i,v in pathsRunning {
  409. WinClose, % v
  410. }
  411.  
  412. liftKeys()
  413.  
  414. applyNewUIOptions()
  415. saveOptions()
  416.  
  417. if (terminate){
  418. OutputDebug, Terminated
  419. ExitApp
  420. }
  421. }
  422.  
  423. global pauseDowns := []
  424. global paused := 0
  425.  
  426. handlePause(){
  427. if (paused){
  428. applyNewUIOptions()
  429. saveOptions()
  430. updateUIOptions()
  431.  
  432. WinActivate, ahk_id %robloxId%
  433. for i,v in pauseDowns {
  434. Send {%v% Down}
  435. }
  436. } else {
  437. pauseDowns := []
  438. for i,v in possibleDowns {
  439. state := GetKeyState(v)
  440. if (state){
  441. pauseDowns.Push(v)
  442. Send {%v% Up}
  443. }
  444. }
  445. updateUIOptions()
  446. Gui mainUI:Show
  447. }
  448. paused := !paused
  449. }
  450.  
  451. global regWalkFactor := 1.25 ; since i made the paths all with vip, normalize
  452.  
  453. getWalkTime(d){
  454. return d*(1 + (regWalkFactor-1)*(1-options.VIP))
  455. }
  456.  
  457. walkSleep(d){
  458. Sleep, % getWalkTime(d)
  459. }
  460.  
  461. press(k, duration := 50) {
  462. Send, {%k% Down}
  463. walkSleep(duration)
  464. Send, {%k% Up}
  465. }
  466. press2(k, k2, duration := 50) {
  467. Send, {%k% Down}
  468. Send, {%k2% Down}
  469. walkSleep(duration)
  470. Send, {%k% Up}
  471. Send, {%k2% Up}
  472. }
  473.  
  474. reset() {
  475. press("Esc",150)
  476. Sleep, 50
  477. press("r",150)
  478. Sleep, 50
  479. press("Enter",150)
  480. Sleep, 50
  481. }
  482. jump() {
  483. press("Space")
  484. }
  485.  
  486. arcaneTeleport(){
  487. press("x",50)
  488. }
  489.  
  490. ; main stuff
  491.  
  492. global initialized := 0
  493. global running := 0
  494.  
  495. initialize()
  496. {
  497. initialized := 1
  498. resetZoom()
  499. if (options.InitialAlign){
  500. ; runPath("initialAlignment",[],1) no more no reset!
  501. }
  502. }
  503.  
  504. resetZoom(){
  505. Loop 2 {
  506. if (checkInvOpen()){
  507. clickMenuButton(1)
  508. } else {
  509. break
  510. }
  511. Sleep, 400
  512. }
  513.  
  514. getRobloxPos(pX,pY,width,height)
  515. MouseMove, % pX + width*0.5, % pY + height*0.5
  516.  
  517. Sleep, 300
  518. MouseClick
  519. Sleep, 250
  520. Loop 20 {
  521. Click, WheelUp
  522. Sleep, 50
  523. }
  524. Loop 10 {
  525. Click, WheelDown
  526. Sleep, 100
  527. }
  528. }
  529.  
  530.  
  531. ; Paths
  532.  
  533. alignCamera(){
  534. closeChat()
  535. Sleep, 200
  536.  
  537. clickMenuButton(2)
  538. Sleep, 500
  539. getRobloxPos(rX,rY,rW,rH)
  540. MouseMove, % rX + rW*0.15, % rY + 44 + rH*0.05 + options.BackOffset
  541. Sleep, 200
  542. MouseClick
  543. Sleep, 500
  544. }
  545.  
  546. align(forCollection := 0){ ; align v2
  547. if (isSpawnCentered && forCollection){
  548. isSpawnCentered := 0
  549. atSpawn := 0
  550. return
  551. }
  552. updateStatus("Aligning Character")
  553. if (atSpawn){
  554. atSpawn := 0
  555. } else {
  556. reset()
  557. Sleep, 4000
  558. }
  559.  
  560. alignCamera()
  561.  
  562. Send, {w Down}
  563. Send, {a Down}
  564. walkSleep(2500)
  565. Send, {a Up}
  566. walkSleep(750)
  567. Send, {w Up}
  568. Sleep, 50
  569. if (forCollection){
  570. Send, {s Down}
  571. Send, {d Down}
  572. walkSleep(1000)
  573. Send, {s Up}
  574. walkSleep(100)
  575. Send, {d Up}
  576. Sleep, 50
  577. } else {
  578. press("s",2500)
  579. Sleep, 50
  580. }
  581. }
  582.  
  583. collect(num){
  584. if (!options["ItemSpot" . num]){
  585. return
  586. }
  587. Loop, 6
  588. {
  589. Send {f}
  590. Sleep, 75
  591. }
  592. Send {e}
  593. Sleep, 50
  594. }
  595.  
  596. runPath(pathName,voidPoints,noCenter = 0){
  597. try {
  598. targetDir := pathDir . pathName . ".ahk"
  599. if (!FileExist(targetDir)){
  600. MsgBox, 0, % "Error",% "Path file: " . targetDir . " does not exist."
  601. return
  602. }
  603. if (HasVal(pathsRunning,targetDir)){
  604. return
  605. }
  606. pathsRunning.Push(targetDir)
  607.  
  608. DetectHiddenWindows, On
  609. Run, % """" . A_AhkPath . """ """ . targetDir . """"
  610.  
  611. stopped := 0
  612.  
  613. Loop 5 {
  614. if (WinExist(targetDir)){
  615. break
  616. }
  617. Sleep, 200
  618. }
  619.  
  620. getRobloxPos(rX,rY,width,height)
  621. scanPoints := [[rX+1,rY+1],[rX+width-2,rY+1],[rX+1,rY+height-2],[rX+width-2,rY+height-2]]
  622.  
  623. voidPoints := voidPoints ? voidPoints : []
  624. startTick := A_TickCount
  625. expectedVoids := 0
  626. voidCooldown := 0
  627.  
  628. while (WinExist(targetDir)){
  629. for i,v in voidPoints {
  630. if (v){
  631. if (A_TickCount-startTick >= getWalkTime(v)){
  632. expectedVoids += 1
  633. voidPoints[i] := 0
  634. }
  635. }
  636. }
  637.  
  638. blackCorners := 0
  639. for i,point in scanPoints {
  640. PixelGetColor, pColor, % point[1], % point[2], RGB
  641. blackCorners += compareColors(pColor,0x000000) < 8
  642. }
  643. PixelGetColor, pColor, % rX+width*0.5, % rY+height*0.5, RGB
  644. centerBlack := compareColors(pColor,0x000000) < 8
  645. if (blackCorners = 3 && centerBlack){
  646. if (!voidCooldown){
  647. voidCooldown := 5
  648. expectedVoids -= 1
  649. if (expectedVoids < 0){
  650. stopped := 1
  651. break
  652. }
  653. }
  654. }
  655. Sleep, 225
  656. voidCooldown := Max(0,voidCooldown-1)
  657. }
  658.  
  659. if (stopped){
  660. WinClose, % targetDir
  661. isSpawnCentered := 0
  662. atSpawn := 1
  663. } else if (!noCenter) {
  664. isSpawnCentered := 1
  665. }
  666. liftKeys()
  667. pathsRunning.Remove(HasVal(pathsRunning,targetDir))
  668. } catch e {
  669. MsgBox, 0,Path Error,% "An error occurred when running path: " . pathDir . "`n:" . e
  670. }
  671. }
  672.  
  673. searchForItemsOld(){
  674. updateStatus("Searching for Items")
  675. ; item 1
  676. updateStatus("Searching for Items (#1)")
  677. press("d",4250)
  678. press("w",1250)
  679. collect(1)
  680.  
  681. ; item 2
  682. updateStatus("Searching for Items (#2)")
  683. press("w",1500)
  684. press("a",250)
  685. press("w",3100)
  686. press("d",250)
  687. collect(2)
  688.  
  689. ; item 3
  690. updateStatus("Searching for Items (#3)")
  691. press("a",500)
  692. press2("s","a",2800)
  693. Send, {a Down}
  694. walkSleep(100)
  695. jump()
  696. walkSleep(700)
  697. jump()
  698. walkSleep(1200)
  699. Send, {w Down}
  700. walkSleep(750)
  701. Send, {a Up}
  702. Send, {w Up}
  703. press("d",250)
  704. press("s",250)
  705. Send, {a Down}
  706. jump()
  707. walkSleep(700)
  708. Send, {a Up}
  709. walkSleep(50)
  710. Send, {w Down}
  711. jump()
  712. walkSleep(900)
  713. Send, {w Up}
  714. press("d",800)
  715. collect(3)
  716.  
  717. ; item 4
  718. updateStatus("Searching for Items (#4)")
  719. press("a",1550)
  720. press("w",1200)
  721. Send, {d Down}
  722. walkSleep(1250)
  723. Send {w Down}
  724. walkSleep(750)
  725. Send {d Up}
  726. Send {w Up}
  727. collect(4)
  728.  
  729. ; item 5
  730. updateStatus("Searching for Items (#5)")
  731. press("a",1500)
  732. press("d",250)
  733. press("s",5100)
  734. press("a",1400)
  735. press("s",600)
  736. collect(5)
  737.  
  738. ; item 6
  739. updateStatus("Searching for Items (#6)")
  740. Send {a Down}
  741. jump()
  742. walkSleep(300)
  743. Send {a Up}
  744. press("s",4100)
  745. press("d",250)
  746. collect(6)
  747.  
  748. ; item 7
  749. updateStatus("Searching for Items (#7)")
  750. Send {s Down}
  751. walkSleep(2500)
  752. press("d",1000)
  753. Send {s Up}
  754. press("w",200)
  755. Send {d Down}
  756. walkSleep(100)
  757. jump()
  758. walkSleep(1250)
  759. Send {s Down}
  760. walkSleep(500)
  761. Send {s Up}
  762. jump()
  763. walkSleep(1000)
  764. Send {s Down}
  765. walkSleep(500)
  766. Send {d Up}
  767. Send {Space Down}
  768. walkSleep(1100)
  769. Send {Space Up}
  770. Send {s Up}
  771. Sleep, 500 ; normal bc waiting for jump to land
  772. press("d",700)
  773. press("w",850)
  774. press("d",150)
  775. collect(7)
  776.  
  777.  
  778. options.CollectionLoops += 1
  779. }
  780.  
  781. searchForItems(){
  782. updateStatus("Searching for Items")
  783.  
  784. atSpawn := 0
  785.  
  786. runPath("searchForItems",[8250],1)
  787.  
  788. options.CollectionLoops += 1
  789. }
  790.  
  791. doObby(){
  792. updateStatus("Doing Obby")
  793.  
  794. runPath("doObby",[],1)
  795.  
  796. options.ObbyAttempts += 1
  797. }
  798.  
  799. walkToObby(){
  800. updateStatus("Walking to Obby")
  801. if(options.ArcanePath){
  802. if(options.VIP){
  803. send {a down}
  804. walkSleep(2300)
  805. jump()
  806. walkSleep(500)
  807. arcaneTeleport()
  808. walkSleep(625)
  809. jump()
  810. walkSleep(1850)
  811. send {a up}
  812. }else{
  813. send {a down}
  814. walkSleep(2300)
  815. jump()
  816. walkSleep(500)
  817. arcaneTeleport()
  818. walkSleep(550)
  819. jump()
  820. walkSleep(1850)
  821. send {a up}
  822. }
  823. } else {
  824. send {a down}
  825. walkSleep(2300)
  826. jump()
  827. walkSleep(2000)
  828. jump()
  829. walkSleep(1850)
  830. send {a up}
  831. }
  832. }
  833.  
  834. obbyRun(){
  835. global lastObby
  836. walkToObby()
  837. Sleep, 250
  838. doObby()
  839. lastObby := A_TickCount
  840. Sleep, 100
  841. }
  842.  
  843. walkToJakesShop(){
  844. press("a",800)
  845. press("s",1200)
  846. }
  847.  
  848. walkToPotionCrafting(){
  849. Send {a Down}
  850. walkSleep(2300)
  851. jump()
  852. walkSleep(300 + 100*(!options.VIP))
  853. Send {a Up}
  854. press("s",9500)
  855. Send {w Down}
  856. jump()
  857. walkSleep(1150)
  858. Send {w Up}
  859. Send {Space Down}
  860. Send {d Down}
  861. walkSleep(2000)
  862. Send {Space Up}
  863. walkSleep(3000)
  864. Send {d Up}
  865. }
  866.  
  867. ; End of paths
  868.  
  869. closeChat(){
  870. getRobloxPos(pX,pY,width,height)
  871. PixelGetColor, chatCheck, % pX + 75, % pY + 12, RGB
  872. if (compareColors(chatCheck,0xffffff) < 16){ ; is chat open??
  873. MouseMove, % pX + 75, % pY + 12
  874. Sleep, 300
  875. MouseClick
  876. Sleep, 100
  877. }
  878. }
  879.  
  880. checkInvOpen(){
  881. checkPos := getPositionFromAspectRatioUV(0.861357, 0.494592,storageAspectRatio)
  882. PixelGetColor, checkC, % checkPos[1], % checkPos[2], RGB
  883. alreadyOpen := compareColors(checkC,0xffffff) < 8
  884. return alreadyOpen
  885. }
  886.  
  887. mouseActions(){
  888. updateStatus("Performing Mouse Actions")
  889.  
  890. getRobloxPos(pX,pY,width,height)
  891.  
  892. ; close jake shop if popup
  893.  
  894. openP := getPositionFromAspectRatioUV(0.718,0.689,599/1015)
  895. openP2 := getPositionFromAspectRatioUV(0.718,0.689,1135/1015)
  896. MouseMove, % openP[1], % openP2[2]
  897. Sleep, 200
  898. MouseClick
  899. Sleep, 200
  900.  
  901. ; re equip
  902. if (options.AutoEquipEnabled){
  903. closeChat()
  904. alreadyOpen := checkInvOpen()
  905.  
  906. if (!alreadyOpen){
  907. clickMenuButton(1)
  908. }
  909. Sleep, 100
  910. sPos := getPositionFromAspectRatioUV(options.AutoEquipX,options.AutoEquipY,storageAspectRatio)
  911. MouseMove, % sPos[1], % sPos[2]
  912. Sleep, 300
  913. MouseClick
  914. Sleep, 100
  915. ePos := getPositionFromAspectRatioUV(storageEquipUV[1],storageEquipUV[2],storageAspectRatio)
  916. MouseMove, % ePos[1], % ePos[2]
  917. Sleep, 300
  918. MouseClick
  919. Sleep, 100
  920. clickMenuButton(1)
  921. }
  922.  
  923. Sleep, 250
  924.  
  925. if (options.ExtraRoblox){ ; for afking my 3rd alt lol
  926. MouseMove, 2150, 700
  927. Sleep, 300
  928. MouseClick
  929. Sleep, 250
  930. jump()
  931. Sleep, 500
  932. Loop 5 {
  933. Send {f}
  934. Sleep, 200
  935. }
  936. MouseMove, 2300,800
  937. Sleep, 300
  938. MouseClick
  939. Sleep, 250
  940. }
  941.  
  942. MouseMove, % pX + width*0.5, % pY + height*0.5
  943. Sleep, 300
  944. MouseClick
  945. Sleep, 250
  946. }
  947.  
  948. isFullscreen() {
  949. WinGetPos,,, w, h, Roblox
  950. return (w = A_ScreenWidth && h = A_ScreenHeight)
  951. }
  952.  
  953. ; used from natro
  954. GetRobloxHWND()
  955. {
  956. if (hwnd := WinExist("Roblox ahk_exe RobloxPlayerBeta.exe"))
  957. return hwnd
  958. else if (WinExist("Roblox ahk_exe ApplicationFrameHost.exe"))
  959. {
  960. ControlGet, hwnd, Hwnd, , ApplicationFrameInputSinkWindow1
  961. return hwnd
  962. }
  963. else
  964. return 0
  965. }
  966.  
  967. getRobloxPos(ByRef x := "", ByRef y := "", ByRef width := "", ByRef height := "", hwnd := ""){
  968. if !hwnd
  969. hwnd := GetRobloxHWND()
  970. VarSetCapacity( buf, 16, 0 )
  971. DllCall( "GetClientRect" , "UPtr", hwnd, "ptr", &buf)
  972. DllCall( "ClientToScreen" , "UPtr", hwnd, "ptr", &buf)
  973.  
  974. x := NumGet(&buf,0,"Int")
  975. y := NumGet(&buf,4,"Int")
  976. width := NumGet(&buf,8,"Int")
  977. height := NumGet(&buf,12,"Int")
  978. }
  979.  
  980.  
  981. ; screen stuff
  982.  
  983. checkHasObbyBuff(BRCornerX, BRCornerY, statusEffectHeight){
  984. if (!options.CheckObbyBuff){
  985. return 1
  986. }
  987. global obbyStatusEffectColor,obbyStatusEffectColor2,hasObbyBuff,statusEffectSpace
  988. Loop, 5
  989. {
  990. targetX := BRCornerX - (statusEffectHeight/2) - (statusEffectHeight + statusEffectSpace)*(A_Index-1)
  991. targetY := BRCornerY - (statusEffectHeight/2)
  992. PixelGetColor, color, targetX, targetY, RGB
  993. if (compareColors(color, obbyStatusEffectColor) < 16){
  994. hasObbyBuff := 1
  995. options.ObbyCompletes += 1
  996. updateStatus("Completed Obby")
  997. return 1
  998. }
  999. }
  1000. hasObbyBuff := 0
  1001. return 0
  1002. }
  1003.  
  1004. getUV(x,y,oX,oY,width,height){
  1005. return [((x-oX)*2 - width)/height,((y-oY)*2 - height)/height]
  1006. }
  1007. getFromUV(uX,uY,oX,oY,width,height){
  1008. return [Floor((uX*height + width)/2)+oX,Floor((uY*height + height)/2)+oY]
  1009. }
  1010.  
  1011. spawnCheck(){ ; not in use
  1012. if (!options.ExtraAlignment) {
  1013. return 1
  1014. }
  1015. getRobloxPos(rX, rY, width, height)
  1016. startPos := getFromUV(-0.55,-0.9,rX,rY,width,height)
  1017. targetPos := getFromUV(-0.45,-0.9,rX,rY,width,height)
  1018. startX := startPos[1]
  1019. startY := startPos[2]
  1020. distance := targetPos[1]-startX
  1021. bitMap := Gdip_BitmapFromScreen(startX "|" startY "|" distance "|1")
  1022. vEffect := Gdip_CreateEffect(5,50,30)
  1023. Gdip_BitmapApplyEffect(bitMap,vEffect)
  1024. ;Gdip_SaveBitmapToFile(bitMap,"test1.png")
  1025. prev := 0
  1026. greatestDiff := 0
  1027. cat := 0
  1028. Loop, %distance%
  1029. {
  1030. c := Gdip_GetPixelColor(bitMap,A_Index-1,0,1)
  1031. if (!prev){
  1032. prev := c
  1033. }
  1034. comp := compareColors(prev,c)
  1035. greatestDiff := Max(comp,greatestDiff)
  1036. if (greatestDiff = comp){
  1037. cat := A_Index
  1038. }
  1039. prev := c
  1040. }
  1041. Gdip_DisposeEffect(vEffect)
  1042. Gdip_DisposeBitmap(bitMap)
  1043. return greatestDiff >= 5
  1044. }
  1045.  
  1046. getColorComponents(color){
  1047. return [color & 255, (color >> 8) & 255, (color >> 16) & 255]
  1048. }
  1049.  
  1050. compareColors(color1, color2) ; determines how far apart 2 colors are
  1051. {
  1052. color1V := getColorComponents(color1)
  1053. color2V := getColorComponents(color2)
  1054.  
  1055. cV := [color1V[1] - color2V[1], color1V[2] - color2V[2], color1V[3] - color2V[3]]
  1056. dist := Abs(cV[1]) + Abs(cV[2]) + Abs(cV[3])
  1057. return dist
  1058. }
  1059.  
  1060. clamp(x,mn,mx){
  1061. nX := Min(x,mx)
  1062. nX := Max(nX,mn)
  1063. return nX
  1064. }
  1065.  
  1066. ; menu ui stuff (ingame)
  1067.  
  1068. global menuBarOffset := 10 ;10 pixels from left edge
  1069.  
  1070. getMenuButtonPosition(num, ByRef posX := "", ByRef posY := ""){ ; num is 1-7, 1 being top, 7 only existing if you are the private server owner
  1071. getRobloxPos(rX, rY, width, height)
  1072.  
  1073. menuBarVSpacing := 10.5*(height/1080)
  1074. menuBarButtonSize := 58*(width/1920)
  1075. menuEdgeCenter := [rX + menuBarOffset, rY + (height/2)]
  1076. startPos := [menuEdgeCenter[1]+(menuBarButtonSize/2),menuEdgeCenter[2]+(menuBarButtonSize/4)-(menuBarButtonSize+menuBarVSpacing-1)*3] ; final factor = 0.5x (x is number of menu buttons visible to all, so exclude private server button)
  1077.  
  1078. posX := startPos[1]
  1079. posY := startPos[2] + (menuBarButtonSize+menuBarVSpacing)*(num-1)
  1080.  
  1081. MouseMove, % posX, % posY
  1082. }
  1083.  
  1084. clickMenuButton(num){
  1085. getMenuButtonPosition(num, posX, posY)
  1086. MouseMove, posX, posY
  1087. Sleep, 200
  1088. MouseClick
  1089. }
  1090.  
  1091. ; storage ratio: w1649 : h952
  1092. global storageAspectRatio := 952/1649
  1093. global storageEquipUV := [-0.625,0.0423] ; equip button
  1094.  
  1095. getAspectRatioSize(ratio, width, height){
  1096. fH := width*ratio
  1097. fW := height*(1/ratio)
  1098.  
  1099. if (height >= fH){
  1100. fW := width
  1101. } else {
  1102. fH := height
  1103. }
  1104.  
  1105. return [Floor(fW+0.5), Floor(fH+0.5)]
  1106. }
  1107.  
  1108. getPositionFromAspectRatioUV(x,y,aspectRatio){
  1109. getRobloxPos(rX, rY, width, height)
  1110.  
  1111. ar := getAspectRatioSize(aspectRatio, width, height)
  1112.  
  1113. oX := Floor((width-ar[1])/2) + rX
  1114. oY := Floor((height-ar[2])/2) + rY
  1115.  
  1116. p := getFromUV(x,y,oX,oY,ar[1],ar[2]) ; [Floor((x*ar[2] + ar[1])/2)+oX,Floor((y*ar[2] + ar[2])/2)+oY]
  1117.  
  1118. return p
  1119. }
  1120.  
  1121. getAspectRatioUVFromPosition(x,y,aspectRatio){
  1122. getRobloxPos(rX, rY, width, height)
  1123.  
  1124. ar := getAspectRatioSize(aspectRatio, width, height)
  1125.  
  1126. oX := Floor((width-ar[1])/2) + rX
  1127. oY := Floor((height-ar[2])/2) + rY
  1128.  
  1129. p := getUV(x,y,oX,oY,ar[1],ar[2])
  1130.  
  1131. return p
  1132. }
  1133.  
  1134. /*
  1135. Sleep, 10000
  1136. MouseGetPos, mx,my
  1137. p := getAspectRatioUVFromPosition(mx,my,storageAspectRatio)
  1138. OutputDebug, % p[1] " " p[2]
  1139. */
  1140.  
  1141. clickCraftingSlot(num,isPotionSlot := 0){
  1142. getRobloxPos(rX,rY,width,height)
  1143.  
  1144. scrollCenter := 0.17*width + rX
  1145. scrollerHeight := 0.78*height
  1146. scrollStartY := 0.15*height + rY
  1147.  
  1148. slotHeight := (width/1920)*138
  1149.  
  1150. if (isPotionSlot){ ; potion select sub menu
  1151. scrollCenter := 0.365*width + rX
  1152. scrollerHeight := 0.38*height
  1153. scrollStartY := 0.325*height + rY
  1154. slotHeight := (width/1920)*129
  1155. }
  1156.  
  1157. MouseMove, % scrollCenter, % scrollStartY-2
  1158. Sleep, 250
  1159. Click, WheelDown ; in case res upd
  1160. Sleep, 100
  1161. Loop 10 {
  1162. Click, WheelUp
  1163. Sleep, 75
  1164. }
  1165.  
  1166. fittingSlots := Floor(scrollerHeight/slotHeight) + (Mod(scrollerHeight, slotHeight) > height*0.045)
  1167. if (fittingSlots < num){
  1168. rCount := num-fittingSlots
  1169. if (num = 13 && !isPotionSlot){
  1170. rCount += 5
  1171. }
  1172. Loop %rCount% {
  1173. Click, WheelDown
  1174. Sleep, 200
  1175. }
  1176. MouseMove, % scrollCenter, % scrollStartY + slotHeight*(fittingSlots-1) + rCount
  1177. } else {
  1178. MouseMove, % scrollCenter, % scrollStartY + slotHeight*(num-1)
  1179. }
  1180.  
  1181. Sleep, 300
  1182. MouseClick
  1183. Sleep, 200
  1184. MouseGetPos, mouseX,mouseY
  1185. MouseMove, % mouseX + width/4, % mouseY
  1186. }
  1187.  
  1188. craftingClickAdd(totalSlots,maxes := 0,isGear := 0){
  1189. if (!maxes){
  1190. maxes := []
  1191. }
  1192.  
  1193. getRobloxPos(rX,rY,width,height)
  1194.  
  1195. startXAmt := 0.6*width + rX
  1196. startX := 0.635*width + rX
  1197. startY := 0.413*height + rY
  1198. slotSize := 0.033*height
  1199.  
  1200. if (isGear){
  1201. startXAmt := 0.582*width + rX
  1202. startX := 0.62*width + rX
  1203. startY := 0.395*height + rY
  1204. slotSize := 0.033*height
  1205. }
  1206.  
  1207. slotI := 1
  1208. Loop %totalSlots% {
  1209. clickCount := maxes[slotI]
  1210. MouseMove, % (clickCount == 1) ? startX : startXAmt, % startY + slotSize*(A_Index-1)
  1211. Sleep, 200
  1212. MouseClick, WheelUp
  1213. Sleep, 200
  1214. if (clickCount > 1){
  1215. MouseClick
  1216. Sleep, 200
  1217. clickCount := clickCount ? clickCount : 100
  1218. Send % clickCount
  1219. Sleep, 200
  1220. }
  1221. MouseMove, % startX, % startY + slotSize*(A_Index-1)
  1222. Sleep, 200
  1223. slotI += 1
  1224. MouseClick
  1225. Sleep, 200
  1226. }
  1227.  
  1228. if (isGear){
  1229. MouseMove, % 0.43*width + rX, % 0.635*height + rY
  1230. } else {
  1231. MouseMove, % 0.46*width + rX, % 0.63*height + rY
  1232. }
  1233. Sleep, 250
  1234. MouseClick
  1235. }
  1236.  
  1237. handleCrafting(){
  1238. getRobloxPos(rX,rY,rW,rH)
  1239. if (options.PotionCraftingEnabled || options.ItemCraftingEnabled){
  1240. updateStatus("Beginning Crafting Cycle")
  1241. }
  1242. if (options.PotionCraftingEnabled){
  1243. align()
  1244. updateStatus("Walking to Stella's Cave (Crafting)")
  1245. walkToPotionCrafting()
  1246. Sleep, 2000
  1247. press("f")
  1248. Sleep, 500
  1249. updateStatus("Crafting Potions")
  1250. Loop 3 {
  1251. v := options["PotionCraftingSlot" A_Index]
  1252. if (v && craftingInfo[potionIndex[v]]){
  1253. info := craftingInfo[potionIndex[v]]
  1254. loopCount := info.attempts
  1255. clickCraftingSlot(info.slot)
  1256. Sleep, 200
  1257. clickCraftingSlot(info.subSlot,1)
  1258. Sleep, 200
  1259. Loop %loopCount% {
  1260. craftingClickAdd(info.addSlots,info.maxes)
  1261. Sleep, 200
  1262. }
  1263. }
  1264. }
  1265. MouseMove, % rX + rW*0.175, % rY + rH*0.05
  1266. Sleep, 200
  1267. MouseClick
  1268. Sleep, 500
  1269. resetZoom()
  1270. }
  1271. if (options.ItemCraftingEnabled){
  1272. align()
  1273. updateStatus("Walking to Jake's Shop (Crafting)")
  1274. walkToJakesShop()
  1275. Sleep, 100
  1276. press("f")
  1277. Sleep, 4500
  1278. openP := getPositionFromAspectRatioUV(-0.718,0.689,599/1015)
  1279. openP2 := getPositionFromAspectRatioUV(-0.718,0.689,1135/1015)
  1280. MouseMove, % openP[1], % openP2[2]
  1281. Sleep, 200
  1282. MouseClick
  1283. Sleep, 500
  1284. updateStatus("Crafting Items")
  1285. if (options.CraftingGildedCoin){
  1286. info := craftingInfo["Gilded Coin"]
  1287. loopCount := info.attempts + Floor(info.addedAttempts*options.CraftingInterval)
  1288. clickCraftingSlot(info.slot)
  1289. Sleep, 200
  1290. Loop %loopCount% {
  1291. craftingClickAdd(info.addSlots,info.maxes,1)
  1292. Sleep, 200
  1293. }
  1294. }
  1295. MouseMove, % rX + rW*0.175, % rY + rH*0.05
  1296. Sleep, 200
  1297. MouseClick
  1298. Sleep, 500
  1299. resetZoom()
  1300. }
  1301. }
  1302.  
  1303. waitForInvVisible(){
  1304. Loop 20 {
  1305. alreadyOpen := checkInvOpen()
  1306. if (alreadyOpen)
  1307. break
  1308. Sleep, 500
  1309. }
  1310. }
  1311.  
  1312. screenshotInventories(){ ; from all closed
  1313. updateStatus("Inventory screenshots")
  1314. topLeft := getPositionFromAspectRatioUV(-1.3,-0.9,storageAspectRatio)
  1315. bottomRight := getPositionFromAspectRatioUV(1.3,0.75,storageAspectRatio)
  1316. totalSize := [bottomRight[1]-topLeft[1]+1,bottomRight[2]-topLeft[2]+1]
  1317.  
  1318. closeChat()
  1319.  
  1320. clickMenuButton(1)
  1321. Sleep, 200
  1322.  
  1323. waitForInvVisible()
  1324.  
  1325. ssMap := Gdip_BitmapFromScreen(topLeft[1] "|" topLeft[2] "|" totalSize[1] "|" totalSize[2])
  1326. Gdip_SaveBitmapToFile(ssMap,ssPath)
  1327. Gdip_DisposeBitmap(ssMap)
  1328. try webhookPost({files:[ssPath],embedImage:"attachment://ss.jpg",embedTitle: "Aura Storage Screenshot"})
  1329.  
  1330. Sleep, 200
  1331. clickMenuButton(3)
  1332. Sleep, 200
  1333.  
  1334. waitForInvVisible()
  1335.  
  1336. itemButton := getPositionFromAspectRatioUV(0.564405, -0.451327, storageAspectRatio)
  1337. MouseMove, % itemButton[1], % itemButton[2]
  1338. Sleep, 200
  1339. MouseClick
  1340. Sleep, 200
  1341.  
  1342. ssMap := Gdip_BitmapFromScreen(topLeft[1] "|" topLeft[2] "|" totalSize[1] "|" totalSize[2])
  1343. Gdip_SaveBitmapToFile(ssMap,ssPath)
  1344. Gdip_DisposeBitmap(ssMap)
  1345. try webhookPost({files:[ssPath],embedImage:"attachment://ss.jpg",embedTitle: "Item Inventory Screenshot"})
  1346.  
  1347. Sleep, 200
  1348. clickMenuButton(3)
  1349. Sleep, 200
  1350. }
  1351.  
  1352. checkBottomLeft(){
  1353. getRobloxPos(rX,rY,width,height)
  1354.  
  1355. start := [rX, rY + height*0.86]
  1356. finish := [rX + width*0.14, rY + height]
  1357. totalSize := [finish[1]-start[1]+1, finish[2]-start[2]+1]
  1358. readMap := Gdip_BitmapFromScreen(start[1] "|" start[2] "|" totalSize[1] "|" totalSize[2])
  1359. ;Gdip_ResizeBitmap(readMap,500,500,1)
  1360. readEffect1 := Gdip_CreateEffect(7,100,-100,50)
  1361. readEffect2 := Gdip_CreateEffect(2,10,100)
  1362. Gdip_BitmapApplyEffect(readMap,readEffect1)
  1363. Gdip_BitmapApplyEffect(readMap,readEffect2)
  1364. Gdip_SaveBitmapToFile(readMap,ssPath)
  1365. OutputDebug, % ocrFromBitmap(readMap)
  1366. Gdip_DisposeBitmap(readMap)
  1367. Gdip_DisposeEffect(readEffect1)
  1368. }
  1369.  
  1370. getUnixTime(){
  1371. now := A_NowUTC
  1372. EnvSub, now,1970, seconds
  1373. return now
  1374. }
  1375.  
  1376.  
  1377. closeRoblox(){
  1378. WinClose, Roblox
  1379. WinClose, % "Roblox Crash"
  1380. }
  1381.  
  1382. playBitMap := Gdip_CreateBitmapFromFile(imgDir . "play.png")
  1383.  
  1384. isPlayButtonOpen(){
  1385. global playBitMap
  1386.  
  1387. getRobloxPos(pX,pY,width,height)
  1388.  
  1389. targetW := height*0.025
  1390. startX := width*0.5 - targetW/2
  1391. retrievedMap := Gdip_BitmapFromScreen(pX + startX "|" pY + height*0.575 "|" targetW "|" height*0.05)
  1392. effect := Gdip_CreateEffect(5,-60,80)
  1393. Gdip_BitmapApplyEffect(retrievedMap,effect)
  1394. playMap := Gdip_ResizeBitmap(retrievedMap,30,30,0)
  1395.  
  1396. blackPixels := 0
  1397. whitePixels := 0
  1398.  
  1399. Loop % 30 {
  1400. tX := A_Index-1
  1401. Loop % 30 {
  1402. tY := A_Index-1
  1403. pixelColor := Gdip_GetPixel(playMap, tX, tY)
  1404. blackPixels += compareColors(pixelColor,0x000000) < 32
  1405. whitePixels += compareColors(pixelColor,0xffffff) < 32
  1406. }
  1407. }
  1408.  
  1409. Gdip_DisposeEffect(effect)
  1410. Gdip_DisposeBitmap(playMap)
  1411. Gdip_DisposeBitmap(retrievedMap)
  1412.  
  1413. if (whitePixels > 30 && blackPixels > 30){
  1414. ratio := whitePixels/blackPixels
  1415.  
  1416. return (ratio > 0.35) && (ratio < 0.65)
  1417. }
  1418. }
  1419.  
  1420. attemptReconnect(failed := 0){
  1421. initialized := 0
  1422. if (reconnecting && !failed){
  1423. return
  1424. }
  1425. if (!options.ReconnectEnabled){
  1426. stop()
  1427. return
  1428. }
  1429. reconnecting := 1
  1430. success := 0
  1431. closeRoblox()
  1432. updateStatus("Reconnecting")
  1433. Sleep, 5000
  1434. Loop 5 {
  1435. Sleep, % (A_Index-1)*10000
  1436. if (options.PrivateServerId && A_Index < 4){
  1437. try Run % """roblox://placeID=15532962292&linkCode=" options.PrivateServerId """"
  1438. } else {
  1439. try Run % """roblox://placeID=15532962292"""
  1440. }
  1441. Loop 240 {
  1442. rHwnd := GetRobloxHWND()
  1443. if (rHwnd){
  1444. WinActivate, ahk_id %rHwnd%
  1445. break
  1446. }
  1447. if (A_Index == 240){
  1448. continue 2
  1449. }
  1450. Sleep 1000
  1451. }
  1452. updateStatus("Reconnecting, Roblox Opened")
  1453. Sleep, 3000
  1454. Loop 120 {
  1455. getRobloxPos(pX,pY,width,height)
  1456.  
  1457. valid := 0
  1458. if (isPlayButtonOpen()){
  1459. Sleep, 2000
  1460. valid := isPlayButtonOpen()
  1461. }
  1462.  
  1463. if (valid){
  1464. MouseMove, % pX + (width/2), % pY + height*0.6
  1465. Sleep, 300
  1466. MouseClick
  1467. break
  1468. }
  1469.  
  1470. if (A_Index == 120 || !GetRobloxHWND()){
  1471. continue 2
  1472. }
  1473. Sleep 1000
  1474. }
  1475. updateStatus("Reconnecting, Game Loaded")
  1476. Sleep, 10000
  1477. getRobloxPos(pX,pY,width,height)
  1478. MouseMove, % pX + (width*0.6), % pY + (height*0.85)
  1479. Sleep, 300
  1480. MouseClick
  1481. Sleep, 100
  1482. MouseMove, % pX + (width*0.35), % pY + (height*0.95)
  1483. Sleep, 300
  1484. MouseClick
  1485. updateStatus("Reconnect Complete")
  1486. success := 1
  1487. break
  1488. }
  1489. if (success){
  1490. reconnecting := 0
  1491. } else {
  1492. Sleep, 30000
  1493. attemptReconnect(1)
  1494. }
  1495. }
  1496.  
  1497. checkDisconnect(wasChecked := 0){
  1498. getRobloxPos(windowX, windowY, windowWidth, windowHeight)
  1499. if ((windowWidth > 0) && !WinExist("Roblox Crash")) {
  1500. pBMScreen := Gdip_BitmapFromScreen(windowX+(windowWidth/4) "|" windowY+(windowHeight/2) "|" windowWidth/2 "|1")
  1501. matches := 0
  1502. hW := windowWidth/2
  1503. Loop %hW% {
  1504. matches += (compareColors(Gdip_GetPixelColor(pBMScreen,A_Index-1,0,1),0x393b3d) < 8)
  1505. if (matches >= 128){
  1506. break
  1507. }
  1508. }
  1509. Gdip_DisposeBitmap(pBMScreen)
  1510. if (matches < 128){
  1511. return 0
  1512. }
  1513. }
  1514. if (wasChecked){
  1515. updateStatus("Roblox Disconnected")
  1516. options.Disconnects += 1
  1517. return 1
  1518. } else {
  1519. Sleep, 3000
  1520. return checkDisconnect(1)
  1521. }
  1522. }
  1523.  
  1524. /*
  1525. testPath := mainDir "images\test.png"
  1526. OutputDebug, testPath
  1527. pbm := Gdip_LoadImageFromFile(testPath) ; Gdip_BitmapFromScreen("0|0|100|100")
  1528. pbm2 := Gdip_ResizeBitmap(pbm,1500,1500,true)
  1529. Gdip_SaveBitmapToFile(pbm2,"test2.png")
  1530.  
  1531. MsgBox, % ocrFromBitmap(pbm2)
  1532. ExitApp
  1533. */
  1534.  
  1535. mainLoop(){
  1536. Global
  1537. if (reconnecting){
  1538. return
  1539. }
  1540. currentId := GetRobloxHWND()
  1541. if (!currentId){
  1542. attemptReconnect()
  1543. return
  1544. } else if (currentId != robloxId){
  1545. OutputDebug, "Window switched"
  1546. robloxId := currentId
  1547. }
  1548.  
  1549. if (checkDisconnect()){
  1550. attemptReconnect()
  1551. return
  1552. }
  1553.  
  1554. MouseGetPos, mouseX, mouseY
  1555. local TLCornerX, TLCornerY, width, height
  1556. getRobloxPos(TLCornerX, TLCornerY, width, height)
  1557. BRCornerX := TLCornerX + width
  1558. BRCornerY := TLCornerY + height
  1559. statusEffectHeight := Floor((height/1080)*54)
  1560.  
  1561. WinActivate, ahk_id %robloxId%
  1562.  
  1563. if (!initialized){
  1564. updateStatus("Initializing")
  1565. initialize()
  1566. }
  1567.  
  1568. tMX := width/2
  1569. tMY := height/2
  1570.  
  1571. mouseActions()
  1572.  
  1573. Sleep, 250
  1574.  
  1575. if (options.InvScreenshotsEnabled && getUnixTime()-options.LastInvScreenshot >= (options.ScreenshotInterval*60)){
  1576. options.LastInvScreenshot := getUnixTime()
  1577.  
  1578. screenshotInventories()
  1579. }
  1580.  
  1581. Sleep, 250
  1582.  
  1583. if (getUnixTime()-options.LastCraftSession >= options.CraftingInterval*60){
  1584. options.LastCraftSession := getUnixTime()
  1585.  
  1586. handleCrafting()
  1587. }
  1588.  
  1589. if (options.DoingObby && (A_TickCount - lastObby) >= (obbyCooldown*1000)){
  1590. align()
  1591. obbyRun()
  1592. hasBuff := checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1593. Sleep, 1000
  1594. hasBuff := hasBuff || checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1595. if (!hasBuff){
  1596. Sleep, 5000
  1597. hasBuff := hasBuff || checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1598. }
  1599. if (!hasBuff)
  1600. {
  1601. align()
  1602. updateStatus("Obby Failed, Retrying")
  1603. lastObby := A_TickCount - obbyCooldown*1000
  1604. obbyRun()
  1605. hasBuff := checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1606. Sleep, 1000
  1607. hasBuff := hasBuff || checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1608. if (!hasBuff){
  1609. Sleep, 5000
  1610. hasBuff := hasBuff || checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1611. }
  1612. if (!hasBuff){
  1613. lastObby := A_TickCount - obbyCooldown*1000
  1614. }
  1615. }
  1616. }
  1617.  
  1618. if (options.CollectItems){
  1619. align(1)
  1620. searchForItems()
  1621. }
  1622.  
  1623. /*
  1624. ;MouseMove, targetX, targetY
  1625. Gui test1:Color, %color%
  1626. GuiControl,,TestT,% checkHasObbyBuff(BRCornerX,BRCornerY,statusEffectHeight)
  1627. */
  1628. }
  1629.  
  1630.  
  1631.  
  1632. ; main ui
  1633.  
  1634. Menu Tray, Icon, shell32.dll, 3
  1635.  
  1636. Gui mainUI: New, +hWndhGui
  1637. Gui Color, 0xDADADA
  1638. Gui Add, Button, gStartClick vStartButton x8 y224 w80 h23, F1 - Start
  1639. Gui Add, Button, gPauseClick vPauseButton x96 y224 w80 h23, F2 - Pause
  1640. Gui Add, Button, gStopClick vStopButton x184 y224 w80 h23, F3 - Stop
  1641. Gui Font, s11 Norm, Segoe UI
  1642. Gui Add, Picture, gDiscordServerClick w26 h20 x462 y226, % mainDir "images\discordIcon.png"
  1643.  
  1644. Gui Add, Tab3, vMainTabs x8 y8 w484 h210 +0x800000, Main|Crafting|Status|Settings|Credits
  1645. ; main tab
  1646. Gui Tab, 1
  1647.  
  1648. Gui Font, s10 w600
  1649. Gui Add, GroupBox, x16 y40 w231 h70 vObbyOptionGroup -Theme +0x50000007, Obby
  1650. Gui Font, s9 norm
  1651. Gui Add, CheckBox, vObbyCheckBox x32 y59 w180 h26 +0x2, % " Do Obby (Every 2 Mins)"
  1652. Gui Add, CheckBox, vObbyBuffCheckBox x32 y80 w200 h26 +0x2, % " Check for Obby Buff Effect"
  1653. Gui Add, Button, gObbyHelpClick vObbyHelpButton x221 y50 w23 h23, ?
  1654.  
  1655. Gui Font, s10 w600
  1656. Gui Add, GroupBox, x252 y40 w231 h70 vAutoEquipGroup -Theme +0x50000007, Auto Equip
  1657. Gui Font, s9 norm
  1658. Gui Add, CheckBox, vAutoEquipCheckBox x268 y61 w190 h22 +0x2, % " Enable Auto Equip"
  1659. Gui Add, Button, gAutoEquipSlotSelectClick vAutoEquipSlotSelectButton x268 y83 w115 h22, Select Storage Slot
  1660. Gui Add, Button, gAutoEquipHelpClick vAutoEquipHelpButton x457 y50 w23 h23, ?
  1661.  
  1662. Gui Font, s10 w600
  1663. Gui Add, GroupBox, x16 y110 w467 h100 vCollectOptionGroup -Theme +0x50000007, Item Collecting
  1664. Gui Font, s9 norm
  1665. Gui Add, CheckBox, vCollectCheckBox x32 y129 w261 h26 +0x2, % " Collect Items Around the Map"
  1666. Gui Add, Button, gCollectHelpClick vCollectHelpButton x457 y120 w23 h23, ?
  1667.  
  1668. Gui Add, GroupBox, x26 y155 w447 h48 vCollectSpotsHolder -Theme +0x50000007, Collect From Spots
  1669. Gui Add, CheckBox, vCollectSpot1CheckBox x42 y174 w30 h26 +0x2, % " 1"
  1670. Gui Add, CheckBox, vCollectSpot2CheckBox x82 y174 w30 h26 +0x2, % " 2"
  1671. Gui Add, CheckBox, vCollectSpot3CheckBox x122 y174 w30 h26 +0x2, % " 3"
  1672. Gui Add, CheckBox, vCollectSpot4CheckBox x162 y174 w30 h26 +0x2, % " 4"
  1673. Gui Add, CheckBox, vCollectSpot5CheckBox x202 y174 w30 h26 +0x2, % " 5"
  1674. Gui Add, CheckBox, vCollectSpot6CheckBox x242 y174 w30 h26 +0x2, % " 6"
  1675. Gui Add, CheckBox, vCollectSpot7CheckBox x282 y174 w30 h26 +0x2, % " 7"
  1676.  
  1677. ; crafting tab
  1678. Gui Tab, 2
  1679. Gui Font, s10 w600
  1680. Gui Add, GroupBox, x16 y40 w231 h110 vItemCraftingGroup -Theme +0x50000007, Item Crafting
  1681. Gui Font, s9 norm
  1682. Gui Add, CheckBox, vItemCraftingCheckBox x32 y58 w190 h22 +0x2, % " Automatic Item Crafting"
  1683. Gui Font, s9 w600
  1684. Gui Add, GroupBox, x21 y80 w221 h65 vItemCraftingOptionsGroup -Theme +0x50000007, Crafting Options
  1685. Gui Font, s9 norm
  1686. Gui Add, CheckBox, vCraftGildedCoinCheckBox x37 y98 w190 h22 +0x2, % " Gilded Coin"
  1687.  
  1688. potionSlotOptions := "None||Fortune Potion I|Haste Potion I|Heavenly Potion I|Universe Potion I|Fortune Potion II|Haste Potion II|Heavenly Potion II|Fortune Potion III"
  1689. Gui Font, s10 w600
  1690. Gui Add, GroupBox, x252 y40 w231 h170 vPotionCraftingGroup -Theme +0x50000007, Potion Crafting
  1691. Gui Font, s9 norm
  1692. Gui Add, CheckBox, vPotionCraftingCheckBox x268 y58 w200 h22 +0x2, % " Automatic Potion Crafting"
  1693. Gui Font, s9 w600
  1694. Gui Add, GroupBox, x257 y80 w221 h125 vPotionCraftingSlotsGroup -Theme +0x50000007, Crafting Slots
  1695. Gui Font, s9 norm
  1696. Gui Add, Text, x270 y107 w100 h16 vItemCraftingSlot1Header BackgroundTrans, Slot 1:
  1697. Gui Add, DropDownList, x312 y103 w120 h10 vPotionCraftingSlot1DropDown R9, % potionSlotOptions
  1698. Gui Add, Text, x270 y140 w100 h16 vItemCraftingSlot2Header BackgroundTrans, Slot 2:
  1699. Gui Add, DropDownList, x312 y136 w120 h10 vPotionCraftingSlot2DropDown R9, % potionSlotOptions
  1700. Gui Add, Text, x270 y173 w100 h16 vItemCraftingSlot3Header BackgroundTrans, Slot 3:
  1701. Gui Add, DropDownList, x312 y169 w120 h10 vPotionCraftingSlot3DropDown R9, % potionSlotOptions
  1702.  
  1703. Gui Font, s10 w600
  1704. Gui Add, GroupBox, x16 y150 w231 h60 vCraftingIntervalGroup -Theme +0x50000007, Crafting Interval
  1705. Gui Font, s10 norm
  1706. Gui Add, Text, x32 y170 w170 h35 vCraftingIntervalText BackgroundTrans, Craft every minutes
  1707. Gui Font, s9 norm
  1708. Gui Add, Edit, x100 y171 w45 h18 vCraftingIntervalInput, 10
  1709. Gui Add, UpDown, vCraftingIntervalUpDown Range1-300, 10
  1710.  
  1711.  
  1712.  
  1713. ; status tab
  1714. Gui Tab, 3
  1715. Gui Font, s10 w600
  1716. Gui Add, GroupBox, x16 y40 w130 h170 vStatsGroup -Theme +0x50000007, Stats
  1717. Gui Font, s9 norm
  1718. Gui Add, Text, vStatsDisplay x22 y58 w118 h146, runtime: 123`ndisconnects: 1000
  1719.  
  1720. Gui Font, s10 w600
  1721. Gui Add, GroupBox, x151 y40 w200 h170 vWebhookGroup -Theme +0x50000007, Discord Webhook
  1722. Gui Font, s7.5 norm
  1723. Gui Add, CheckBox, vWebhookCheckBox x166 y63 w120 h16 +0x2 gEnableWebhookToggle, % " Enable Webhook"
  1724. Gui Add, Text, x161 y85 w100 h20 vWebhookInputHeader BackgroundTrans, Webhook URL:
  1725. Gui Add, Edit, x166 y103 w169 h18 vWebhookInput,% ""
  1726. Gui Add, Button, gWebhookHelpClick vWebhookHelpButton x325 y50 w23 h23, ?
  1727. Gui Add, CheckBox, vWebhookImportantOnlyCheckBox x166 y126 w140 h16 +0x2, % " Important events only"
  1728. Gui Add, Text, vWebhookUserIDHeader x161 y145 w150 h14 BackgroundTrans, % "Discord User ID (Pings):"
  1729. Gui Add, Edit, x166 y162 w169 h16 vWebhookUserIDInput,% ""
  1730. Gui Font, s7.4 norm
  1731. Gui Add, CheckBox, vWebhookInventoryScreenshots x161 y182 w130 h26 +0x2, % "Inventory Screenshots (mins)"
  1732. Gui Add, Edit, x294 y186 w50 h18
  1733. Gui Add, UpDown, vInvScreenshotinterval Range1-1440
  1734.  
  1735. Gui Font, s10 w600
  1736. Gui Add, GroupBox, x356 y40 w128 h50 vStatusOtherGroup -Theme +0x50000007, Other
  1737. Gui Font, s9 norm
  1738. Gui Add, CheckBox, vStatusBarCheckBox x366 y63 w110 h20 +0x2, % " Enable Status Bar"
  1739.  
  1740. Gui Font, s9 w600
  1741. Gui Add, GroupBox, x356 y90 w128 h120 vRollDetectionGroup -Theme +0x50000007, Roll Detection
  1742. Gui Font, s8 norm
  1743. Gui Add, Button, gRollDetectionHelpClick vRollDetectionHelpButton x458 y99 w23 h23, ?
  1744. Gui Add, Text, vWebhookRollSendHeader x365 y110 w110 h16 BackgroundTrans, % "Send Minimum:"
  1745. Gui Add, Edit, vWebhookRollSendInput x370 y126 w102 h18, 10000
  1746. Gui Add, Text, vWebhookRollPingHeader x365 y146 w110 h16 BackgroundTrans, % "Ping Minimum:"
  1747. Gui Add, Edit, vWebhookRollPingInput x370 y162 w102 h18, 100000
  1748. Gui Add, CheckBox, vWebhookRollImageCheckBox gWebhookRollImageCheckBoxClick x365 y183 w100 h18, Aura Images
  1749.  
  1750. ; settings tab
  1751. Gui Tab, 4
  1752. Gui Font, s10 w600
  1753. Gui Add, GroupBox, x16 y40 w467 h65 vGeneralSettingsGroup -Theme +0x50000007, General
  1754. Gui Font, s9 norm
  1755. Gui Add, CheckBox, vVIPCheckBox x32 y58 w150 h22 +0x2, % " VIP Gamepass Owned"
  1756. Gui Add, CheckBox, vArcaneCheckBox gArcaneCheckBoxClick x222 y58 w200 h22 +0x2, % " Arcane Teleport Paths"
  1757. Gui Add, Text, x222 y82 w200 h18, % "Collection Back Button Y Offset:"
  1758. Gui Add, Edit, x396 y81 w50 h18
  1759. Gui Add, UpDown, vBackOffsetUpDown Range-500-500, 0
  1760. Gui Add, Button, vImportSettingsButton gImportSettingsClick x30 y80 w130 h20, Import Settings
  1761.  
  1762. Gui Font, s10 w600
  1763. Gui Add, GroupBox, x16 y105 w467 h105 vReconnectSettingsGroup -Theme +0x50000007, Reconnect
  1764. Gui Font, s9 norm
  1765. Gui Add, CheckBox, vReconnectCheckBox x32 y127 w300 h16 +0x2, % " Enable Reconnect (Will reconnect if you disconnect)"
  1766. Gui Add, Text, x26 y148 w100 h20 vPrivateServerInputHeader BackgroundTrans, Private Server Link:
  1767. Gui Add, Edit, x31 y167 w437 h20 vPrivateServerInput,% ""
  1768.  
  1769.  
  1770. ; credits tab
  1771. Gui Tab, 5
  1772. Gui Font, s10 w600
  1773. Gui Add, GroupBox, x16 y40 w231 h133 vCreditsGroup -Theme +0x50000007, The Creator
  1774. Gui Add, Picture, w75 h75 x23 y62, % mainDir "images\pfp.png"
  1775. Gui Font, s12 w600
  1776. Gui Add, Text, x110 y57 w130 h22,BuilderDolphin
  1777. Gui Font, s8 norm italic
  1778. Gui Add, Text, x120 y78 w80 h18,(dolphin)
  1779. Gui Font, s8 norm
  1780. Gui Add, Text, x115 y95 w124 h40,"This was supposed to be a short project to learn AHK..."
  1781. Gui Font, s8 norm
  1782. Gui Add, Text, x28 y145 w200 h32 BackgroundTrans,% "More to come soon perhaps..."
  1783. Gui Add, Button, x28 y177 w206 h32 gMoreCreditsClick,% "More Credits"
  1784.  
  1785. Gui Font, s10 w600
  1786. Gui Add, GroupBox, x252 y40 w231 h90 vCreditsGroup2 -Theme +0x50000007, The Inspiration
  1787. Gui Add, Picture, w60 h60 x259 y62, % mainDir "images\auryn.ico"
  1788. Gui Font, s8 norm
  1789. Gui Add, Text, x326 y59 w150 h68,% "Natro Macro, a macro for Bee Swarm Simulator has greatly inspired this project and has helped me create this project overall."
  1790.  
  1791. Gui Font, s10 w600
  1792. Gui Add, GroupBox, x252 y130 w231 h80 vCreditsGroup3 -Theme +0x50000007, Other
  1793. Gui Font, s9 norm
  1794. Gui Add, Link, x268 y150 w200 h55, Join the <a href="https://discord.gg/DYUqwJchuV">Discord Server</a>! (Community)`n`nVisit the <a href="https://github.com/BuilderDolphin/dolphSol-Macro">GitHub</a>! (Updates + Versions)
  1795.  
  1796. Gui Show, % "w500 h254 x" clamp(options.WindowX,10,A_ScreenWidth-100) " y" clamp(options.WindowY,10,A_ScreenHeight-100), % "dolphSol Macro " version
  1797.  
  1798.  
  1799. ; status bar
  1800. Gui statusBar:New, AlwaysOnTop
  1801. Gui Font, s10 norm
  1802. Gui Add, Text, x5 y5 w210 h15 vStatusBarText, Status: Waiting...
  1803.  
  1804.  
  1805. Gui mainUI:Default
  1806.  
  1807.  
  1808. global directValues := {"ObbyCheckBox":"DoingObby"
  1809. ,"ArcaneCheckBox":"ArcanePath"
  1810. ,"ObbyBuffCheckBox":"CheckObbyBuff"
  1811. ,"CollectCheckBox":"CollectItems"
  1812. ,"VIPCheckBox":"VIP"
  1813. ,"BackOffsetUpDown":"BackOffset"
  1814. ,"AutoEquipCheckBox":"AutoEquipEnabled"
  1815. ,"CraftingIntervalUpDown":"CraftingInterval"
  1816. ,"ItemCraftingCheckBox":"ItemCraftingEnabled"
  1817. ,"InvScreenshotinterval":"ScreenshotInterval"
  1818. ,"CraftGildedCoinCheckBox":"CraftingGildedCoin"
  1819. ,"PotionCraftingCheckBox":"PotionCraftingEnabled"
  1820. ,"ReconnectCheckBox":"ReconnectEnabled"
  1821. ,"WebhookCheckBox":"WebhookEnabled"
  1822. ,"WebhookInput":"WebhookLink"
  1823. ,"WebhookImportantOnlyCheckBox":"WebhookImportantOnly"
  1824. ,"WebhookRollImageCheckBox":"WebhookAuraRollImages"
  1825. ,"WebhookUserIDInput":"DiscordUserID"
  1826. ,"WebhookInventoryScreenshots":"InvScreenshotsEnabled"
  1827. ,"StatusBarCheckBox":"StatusBarEnabled"}
  1828.  
  1829. global directNumValues := {"WebhookRollSendInput":"WebhookRollSendMinimum"
  1830. ,"WebhookRollPingInput":"WebhookRollPingMinimum"}
  1831.  
  1832. updateUIOptions(){
  1833. for i,v in directValues {
  1834. GuiControl,,%i%,% options[v]
  1835. }
  1836.  
  1837. for i,v in directNumValues {
  1838. GuiControl,,%i%,% options[v]
  1839. }
  1840.  
  1841. if (options.PrivateServerId){
  1842. GuiControl,, PrivateServerInput,% privateServerPre options.PrivateServerId
  1843. } else {
  1844. GuiControl,, PrivateServerInput,% ""
  1845. }
  1846.  
  1847. Loop 7 {
  1848. v := options["ItemSpot" . A_Index]
  1849. GuiControl,,CollectSpot%A_Index%CheckBox,%v%
  1850. }
  1851.  
  1852. Loop 3 {
  1853. v := options["PotionCraftingSlot" . A_Index]
  1854. GuiControl,ChooseString,PotionCraftingSlot%A_Index%DropDown,% potionIndex[v]
  1855. }
  1856. }
  1857. updateUIOptions()
  1858.  
  1859. validateWebhookLink(link){
  1860. return RegexMatch(link, "i)https:\/\/(canary\.|ptb\.)?(discord|discordapp)\.com\/api\/webhooks\/([\d]+)\/([a-z0-9_-]+)") ; filter by natro
  1861. }
  1862.  
  1863. applyNewUIOptions(){
  1864. global hGui
  1865. Gui mainUI:Default
  1866.  
  1867. VarSetCapacity(wp, 44), NumPut(44, wp)
  1868. DllCall("GetWindowPlacement", "uint", hGUI, "uint", &wp)
  1869. x := NumGet(wp, 28, "int"), y := NumGet(wp, 32, "int")
  1870.  
  1871. options.WindowX := x
  1872. options.WindowY := y
  1873.  
  1874. for i,v in directValues {
  1875. GuiControlGet, rValue,,%i%
  1876. options[v] := rValue
  1877. }
  1878.  
  1879. for i,v in directNumValues {
  1880. GuiControlGet, rValue,,%i%
  1881. m := 0
  1882. if rValue is number
  1883. m := 1
  1884. options[v] := m ? rValue : 0
  1885. }
  1886.  
  1887. GuiControlGet, privateServerL,,PrivateServerInput
  1888. if (privateServerL){
  1889. RegExMatch(privateServerL, "(?<=privateServerLinkCode=)(.{32})", serverId)
  1890. if (!serverId && RegExMatch(privateServerL, "(?<=code=)(.{32})")){
  1891. MsgBox, % "The private server link you provided is a share link, instead of a privateServerLinkCode link. To get the code link, paste the share link into your browser and run it. This should convert the link to a privateServerLinkCode link. Copy and paste the converted link into the Private Server setting to fix this issue.`n`nThe link should look like: https://www.roblox.com/games/15532962292/Sols-RNG?privateServerLinkCode=..."
  1892. }
  1893. options.PrivateServerId := serverId ""
  1894. }
  1895.  
  1896. GuiControlGet, webhookLink,,WebhookInput
  1897. if (webhookLink){
  1898. valid := validateWebhookLink(webhookLink)
  1899. if (valid){
  1900. options.WebhookLink := webhookLink
  1901. } else {
  1902. if (options.WebhookLink){
  1903. MsgBox,0,New Webhook Link Invalid, % "Invalid webhook link, the link has been reverted to your previous valid one."
  1904. } else {
  1905. MsgBox,0,Webhook Link Invalid, % "Invalid webhook link, the webhook option has been disabled."
  1906. options.WebhookEnabled := 0
  1907. }
  1908. }
  1909. }
  1910.  
  1911. Loop 7 {
  1912. GuiControlGet, rValue,,CollectSpot%A_Index%CheckBox
  1913. options["ItemSpot" . A_Index] := rValue
  1914. }
  1915.  
  1916. Loop 3 {
  1917. GuiControlGet, rValue,,PotionCraftingSlot%A_Index%DropDown
  1918. options["PotionCraftingSlot" . A_Index] := reversePotionIndex[rValue]
  1919. }
  1920. }
  1921.  
  1922. global importingSettings := 0
  1923. handleImportSettings(){
  1924. global configPath
  1925.  
  1926. if (importingSettings){
  1927. return
  1928. }
  1929.  
  1930. MsgBox, % 1 + 4096, % "Import Settings", % "To import the settings from a previous version folder of the Macro, please select the ""config.ini"" file located in the previous version's ""settings"" folder when prompted. Press OK to begin."
  1931.  
  1932. IfMsgBox, Cancel
  1933. return
  1934.  
  1935. importingSettings := 1
  1936.  
  1937. FileSelectFile, targetPath, 3,, Import dolphSol Settings Through a config.ini File, % "Configuration settings (config.ini)"
  1938.  
  1939. if (targetPath && RegExMatch(targetPath,"\\config\.ini")){
  1940. if (targetPath != configPath){
  1941. FileRead, retrieved, %targetPath%
  1942.  
  1943. if (!ErrorLevel){
  1944. FileDelete, %configPath%
  1945. FileAppend, %retrieved%, %configPath%
  1946.  
  1947. loadData()
  1948. updateUIOptions()
  1949. saveOptions()
  1950.  
  1951. MsgBox, 0,Import Settings,% "Success!"
  1952. } else {
  1953. MsgBox,0,Import Settings Error, % "An error occurred while reading the file, please try again."
  1954. }
  1955. } else {
  1956. MsgBox, 0,Import Settings Error, % "Cannot import settings from the current macro!"
  1957. }
  1958. }
  1959.  
  1960. importingSettings := 0
  1961. }
  1962.  
  1963. handleWebhookEnableToggle(){
  1964. GuiControlGet, rValue,,WebhookCheckBox
  1965.  
  1966. if (rValue){
  1967. GuiControlGet, link,,WebhookInput
  1968. if (!validateWebhookLink(link)){
  1969. GuiControl, , WebhookCheckBox,0
  1970. MsgBox,0,Webhook Link Invalid, % "Invalid webhook link, the webhook option has been disabled."
  1971. }
  1972. }
  1973. }
  1974.  
  1975. global statDisplayInfo := {"RunTime":"Run Time"
  1976. ,"Disconnects":"Disconnects"
  1977. ,"ObbyCompletes":"Obby Completes"
  1978. ,"ObbyAttempts":"Obby Attempts"
  1979. ,"CollectionLoops":"Collection Loops"}
  1980.  
  1981. formatNum(n,digits := 2){
  1982. n := Floor(n+0.5)
  1983. cDigits := Max(1,Ceil(Log(Max(n,1))))
  1984. final := n
  1985. if (digits > cDigits){
  1986. loopCount := digits-cDigits
  1987. Loop %loopCount% {
  1988. final := "0" . final
  1989. }
  1990. }
  1991. return final
  1992. }
  1993.  
  1994. getTimerDisplay(t){
  1995. return formatNum(Floor(t/86400)) . ":" . formatNum(Floor(Mod(t,86400)/3600)) . ":" . formatNum(Floor(Mod(t,3600)/60)) . ":" . formatNum(Mod(t,60))
  1996. }
  1997.  
  1998. updateUI(){
  1999. ; per 1s
  2000. if (running){
  2001. options.RunTime += 1
  2002. }
  2003.  
  2004. statText := ""
  2005. for i,v in statDisplayInfo {
  2006. value := options[i]
  2007. if (statText){
  2008. statText .= "`n"
  2009. }
  2010. if (i = "RunTime"){
  2011. value := getTimerDisplay(value)
  2012. }
  2013. statText .= v . ": " . value
  2014. }
  2015. GuiControl, , StatsDisplay, % statText
  2016. }
  2017. updateUI()
  2018.  
  2019. global statusColors := {"Starting Macro":3447003
  2020. ,"Roblox Disconnected":15548997
  2021. ,"Reconnecting":9807270
  2022. ,"Reconnecting, Roblox Opened":9807270
  2023. ,"Reconnecting, Game Loaded":9807270
  2024. ,"Reconnect Complete":3447003
  2025. ,"Initializing":3447003
  2026. ,"Searching for Items":15844367
  2027. ,"Doing Obby":15105570
  2028. ,"Completed Obby":5763719
  2029. ,"Obby Failed, Retrying":11027200
  2030. ,"Macro Stopped":3447003
  2031. ,"Beginning Crafting Cycle":1752220}
  2032.  
  2033. global importantStatuses := {"Starting Macro":1
  2034. ,"Roblox Disconnected":1
  2035. ,"Reconnecting":1
  2036. ,"Reconnecting, Roblox Opened":1
  2037. ,"Reconnecting, Game Loaded":1
  2038. ,"Reconnect Complete":1
  2039. ,"Initializing":1
  2040. ,"Macro Stopped":1}
  2041.  
  2042. updateStatus(newStatus){
  2043. if (options.WebhookEnabled){
  2044. FormatTime, fTime, , HH:mm:ss
  2045. if (!options.WebhookImportantOnly || importantStatuses[newStatus]){
  2046. try webhookPost({embedContent: "[" fTime "]: " newStatus,embedColor: (statusColors[newStatus] ? statusColors[newStatus] : 1)})
  2047. }
  2048. }
  2049. GuiControl,statusBar:,StatusBarText,% "Status: " newStatus
  2050. }
  2051.  
  2052. global selectingAutoEquip := 0
  2053.  
  2054. startAutoEquipSelection(){
  2055. if (selectingAutoEquip || macroStarted){
  2056. return
  2057. }
  2058.  
  2059. MsgBox, % 1 + 4096, Begin Auto Equip Selection, % "Once you press OK, please click on the inventory slot that you would like to automatically equip.`n`nPlease ensure that your storage is open upon pressing OK. Press Cancel if it is not open yet."
  2060.  
  2061. IfMsgBox, Cancel
  2062. return
  2063.  
  2064. if (macroStarted){
  2065. return
  2066. }
  2067.  
  2068. selectingAutoEquip := 1
  2069.  
  2070. w:=A_ScreenWidth,h:=A_ScreenHeight-2
  2071. Gui Dimmer:New,+AlwaysOnTop +ToolWindow -Caption +E0x20 ;Clickthru
  2072. Gui Color, 333333
  2073. Gui Show,NoActivate x0 y0 w%w% h%h%,Dimmer
  2074. WinSet Transparent,% 75,Dimmer
  2075. Gui DimmerTop:New,+AlwaysOnTop +ToolWindow -Caption +E0x20
  2076. Gui Color, 222222
  2077. Gui Font, s13
  2078. Gui Add, Text, % "x0 y0 w400 h40 cWhite 0x200 Center", Click the target storage slot (Right-click to cancel)
  2079. Gui Show,% "NoActivate x" (A_ScreenWidth/2)-200 " y25 w400 h40"
  2080.  
  2081. Gui mainUI:Hide
  2082. }
  2083.  
  2084. cancelAutoEquipSelection(){
  2085. if (!selectingAutoEquip) {
  2086. return
  2087. }
  2088. Gui Dimmer:Destroy
  2089. Gui DimmerTop:Destroy
  2090. Gui mainUI:Show
  2091. selectingAutoEquip := 0
  2092. }
  2093.  
  2094. completeAutoEquipSelection(){
  2095. if (!selectingAutoEquip){
  2096. return
  2097. }
  2098. applyNewUIOptions()
  2099.  
  2100. MouseGetPos, mouseX,mouseY
  2101. uv := getAspectRatioUVFromPosition(mouseX,mouseY,storageAspectRatio)
  2102. options.AutoEquipX := uv[1]
  2103. options.AutoEquipY := uv[2]
  2104.  
  2105. saveOptions()
  2106. cancelAutoEquipSelection()
  2107.  
  2108. MsgBox, 0,Auto Equip Selection,Success!
  2109. }
  2110.  
  2111. handleLClick(){
  2112. if (selectingAutoEquip){
  2113. completeAutoEquipSelection()
  2114. }
  2115. }
  2116.  
  2117. handleRClick(){
  2118. if (selectingAutoEquip){
  2119. cancelAutoEquipSelection()
  2120. }
  2121. }
  2122.  
  2123. SetTimer, SecondTick, 1000
  2124.  
  2125. startMacro(){
  2126. if (!canStart){
  2127. return
  2128. }
  2129. if (macroStarted) {
  2130. return
  2131. }
  2132. macroStarted := 1
  2133. updateStatus("Starting Macro")
  2134.  
  2135. ; cancel any interfering stuff
  2136. cancelAutoEquipSelection()
  2137.  
  2138. applyNewUIOptions()
  2139. saveOptions()
  2140.  
  2141. Gui, mainUI:+LastFoundExist
  2142. WinSetTitle, % "dolphSol Macro " version " (Running)"
  2143.  
  2144. Run, % """" . A_AhkPath . """ """ mainDir . "lib\status.ahk"""
  2145.  
  2146. if (options.StatusBarEnabled){
  2147. Gui statusBar:Show, % "w220 h25 x" (A_ScreenWidth-300) " y50", dolphSol Status
  2148. }
  2149.  
  2150. robloxId := GetRobloxHWND()
  2151. if (!robloxId){
  2152. attemptReconnect()
  2153. }
  2154.  
  2155. running := 1
  2156. WinActivate, ahk_id %robloxId%
  2157. while running {
  2158. try mainLoop()
  2159. catch e
  2160. try webhookPost({embedContent: "what: " e.what ", file: " e.file
  2161. . ", line: " e.line ", message: " e.message ", extra: " e.extra,embedTitle: "Error Received",color: 15548997})
  2162.  
  2163. Sleep, 2000
  2164. }
  2165. }
  2166.  
  2167. if (!options.FirstTime){
  2168. options.FirstTime := 1
  2169. saveOptions()
  2170. MsgBox, 0,dolphSol Macro - Welcome, % "Welcome to dolphSol macro!`n`nIf this is your first time here, make sure to go through all of the tabs to make sure your settings are right.`n`nIf you are here from an update, remember that you can import all of your previous settings in the Settings menu.`n`nMake sure join the Discord server and check the GitHub page for the community and future updates, which can both be found in the Credits page. (Discord link is also in the bottom right corner)"
  2171. }
  2172.  
  2173. if (!options.WasRunning){
  2174. options.WasRunning := 1
  2175. saveOptions()
  2176.  
  2177. }
  2178.  
  2179. canStart := 1
  2180.  
  2181. return
  2182.  
  2183. ; button stuff
  2184.  
  2185. StartClick:
  2186. startMacro()
  2187. return
  2188.  
  2189. PauseClick:
  2190. MsgBox, 0,% "Pause",% "Please note that the pause feature isn't very stable currently. It is suggested to stop instead."
  2191. Pause
  2192. return
  2193.  
  2194. StopClick:
  2195. stop()
  2196. Reload
  2197. return
  2198.  
  2199. AutoEquipSlotSelectClick:
  2200. startAutoEquipSelection()
  2201. return
  2202.  
  2203. DiscordServerClick:
  2204. Run % "https://discord.gg/DYUqwJchuV"
  2205. return
  2206.  
  2207. EnableWebhookToggle:
  2208. handleWebhookEnableToggle()
  2209. return
  2210.  
  2211. ImportSettingsClick:
  2212. handleImportSettings()
  2213. return
  2214.  
  2215. WebhookRollImageCheckBoxClick:
  2216. Gui mainUI:Default
  2217. GuiControlGet, v,, WebhookRollImageCheckBox
  2218. if (v){
  2219. MsgBox, 0, Aura Roll Image Warning, % "Warning: Currently, the aura image display for the webhook is fairly unstable, and may cause random delays in webhook sends due to image loading. Enable at your own risk."
  2220. }
  2221. return
  2222.  
  2223. ArcaneCheckBoxClick:
  2224. Gui mainUI:Default
  2225. GuiControlGet,v,,ArcaneCheckBox
  2226. if (v){
  2227. MsgBox, 0, Arcane Teleport Notice, % "With the Arcane Teleport option enabled, please ensure that you are auto-equipping any type of Arcane aura at ALL TIMES, otherwise your paths will break.`n`nRemember: It is preferred to select a slot with Arcane in the non-scrolled Aura Storage state (not scrolled down), as reconnecting will reset the scroll upon rejoin, possibly causing you to select a different aura."
  2228. }
  2229. return
  2230.  
  2231. MoreCreditsClick:
  2232. creditText =
  2233. (
  2234. Development
  2235.  
  2236. - Assistant Developer - Stanley (stanleyrekt)
  2237. - Path Contribution - sanji (sir.moxxi), Flash (drflash55)
  2238. - Path Inspiration - Aod_Shanaenae
  2239.  
  2240. Supporters (Donations)
  2241.  
  2242. - @Bigman
  2243. - @sir.moxxi (sanji)
  2244. - @zrx
  2245. - @dj_frost
  2246. - @FlamePrince101 - Member
  2247. - @jw
  2248. - @Maz - Member
  2249. - @dead_is4
  2250. - @CorruptExpy_II
  2251. - @Ami.n
  2252. - @s.a.t.s
  2253. - @UnamedWasp - Member
  2254. - @JujuFRFX
  2255. - @Xon67
  2256. - @NightLT98 - Member
  2257.  
  2258. Thank you to everyone who currently supports and uses the macro! You guys are amazing!
  2259. )
  2260. MsgBox, 0, More Credits, % creditText
  2261. return
  2262.  
  2263. ; help buttons
  2264.  
  2265. ObbyHelpClick:
  2266. MsgBox, 0, Obby, % "Section for attempting to complete the Obby on the map for the +30% luck buff every 2 minutes. If you have the VIP Gamepass, make sure to enable it in Settings.`n`nCheck For Obby Buff Effect - Checks your status effects upon completing the obby and attempts to find the buff. If it is missing, the macro will retry the obby one more time. Disable this if your macro keeps retrying the obby after completing it. The ObbyCompletes stat will only increase if this check is enabled.`n`nPLEASE NOTE: The macro's obby completion ability HIGHLY depends on a stable frame-rate, and will likely fail from any frame freezes. If your macro is unable to complete the obby at all, it is best to disable this option."
  2267. return
  2268.  
  2269. AutoEquipHelpClick:
  2270. MsgBox, 0, Auto Equip, % "Section for automatically equipping a specified aura every macro round. This is important for equipping auras without walk animations, which may interfere with the macro. This defaults to your first storage slot if not selected. Enabling this will close your chat window due to it possibly getting in the way of the storage button.`n`nUse the Select Storage Slot button to select a slot in your Aura Storage to automatically equip. Right click when selecting to cancel.`n`nThis feature is HIGHLY RECOMMENDED to be used on a non-animation aura for best optimization."
  2271. return
  2272.  
  2273. CollectHelpClick:
  2274. MsgBox, 0, Item Collecting, % "Section for automatically collecting naturally spawned items around the map. Enabling this will have the macro check the selected spots every loop after doing the obby (if enabled and ready).`n`nYou can also specify which spots to collect from. If a spot is disabled, the macro will not grab any items from the spot. Please note that the macro always takes the same path, it just won't collect from a spot if it's disabled. This feature is useful if you are sharing a server with a friend, and split the spots with them.`n`nItem Spots:`n 1 - Left of the Leaderboards`n 2 - Bottom left edge of the Map`n 3 - Under a tree next to the House`n 4 - Inside the House`n 5 - Under the tree next to Jake's Shop`n 6 - Under the tree next to the Mountain`n 7 - On top of the Hill with the Cave"
  2275. return
  2276.  
  2277. WebhookHelpClick:
  2278. MsgBox, 0, Discord Webhook, % "Section for connecting a Discord Webhook to have status messages displayed in a target Discord Channel. Enable this option by entering a valid Discord Webhook link.`n`nTo create a webhook, you must have Administrator permissions in a server (preferably your own, separate server). Go to your target channel, then configure it. Go to Integrations, and create a Webhook in the Webhooks Section. After naming it whatever you like, copy the Webhook URL, then paste it into the macro. Now you can enable the Discord Webhook option!`n`nRequires a valid Webhook URL to enable.`n`nImportant events only - The webhook will only send important events such as disconnects, rolls, and initialization, instead of all of the obby/collecting/crafting ones.`n`nYou can provide your Discord ID here as well to be pinged for rolling a rarity group or higher when detected by the system. You can select the minimum notification/send rarity in the Roll Detection system.`n`nHourly Inventory Screenshots - Screenshots of both your Aura Storage and Item Inventory are sent to your webhook."
  2279. return
  2280.  
  2281. RollDetectionHelpClick:
  2282. MsgBox, 0, Roll Detection, % "Section for detecting rolled auras through the registered star color (if 10k+). Any 10k+ auras that can be sent will be sent to the webhook, with the option to ping if the rarity is above the minimum.`n`nFor minimum settings, the number determines the lowest possible rarity the webhook will send/ping for. Values of 0 will disable the option completely. Values under 10,000 will toggle all 1k+ rolls, due to them being near undetectable.`n`nAura Images can be toggled to show the wiki-based images of your rolled auras in the webhook. WARNING: After some testing, this has proven to show some lag, leading to some send delay issues. Use at your own risk!"
  2283. return
  2284.  
  2285. f1::startMacro()
  2286. f2::Pause
  2287. f3::
  2288. stop()
  2289. Reload
  2290.  
  2291. ~LButton::handleLClick()
  2292. ~RButton::handleRClick()
  2293.  
  2294. mainUIGuiClose:
  2295. stop(1)
  2296.  
  2297. SecondTick:
  2298. updateUI()
Add Comment
Please, Sign In to add comment