Last active
June 2, 2025 20:43
-
-
Save NotoriousPyro/07e02a56078876aa74da63b03731b21d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires AutoHotkey v2.0 | |
; not all functionality works and needs more development. | |
; needs the images from https://1drv.ms/u/c/9c355537264f471c/ERTkS6VbWl9JmISKGfV1DBkBF3TE414qLDESimy5lSzgzQ?e=hC2mUo | |
; working: | |
; F4: autoyeet | |
; can also change teams if fully configured to optimize throwing team, but needs more set up to do it and is disabled by default (false 2nd parameter of AutoFarmStarsEnergyAndEnchants) | |
; - character needs to be aligned so it is facing perfectly forward | |
; - need to set THROW_CLICK_POS_X and Y (empty position in window where no other elements appear) | |
; - need to set THROW_SCREEN_CLOSE_POS_X and Y (top left of open/close throw screen button) | |
; - need to set THROW_SCREEN_CLOSE_POS_X2 and Y2 (bottom right of open/close throw screen button) | |
; F5: autoyeet and enchant | |
; same as F4 but also operates the enchant screen | |
; - character needs to be aligned so it is facing perfectly forward, then move to enchant area, click enchant and quickly move away before it ends so the screen stays open | |
; - need to set THROW_CLICK_POS_X and Y (empty position in window where no other elements appear) | |
; - need to set THROW_SCREEN_CLOSE_POS_X and Y (top left of open/close throw screen button) | |
; - need to set THROW_SCREEN_CLOSE_POS_X2 and Y2 (bottom right of open/close throw screen button) | |
; - need to set ENCHANT_CLICK_POS_X and Y (location of click enchant button) | |
; F6: auto open eggs quickly | |
; - need to set THROW_CLICK_POS_X and Y so that there is somewhere to click to speed up closing the open eggs screen | |
; F9: auto spin wheel | |
; - need to set SPIN_POS_X and Y | |
CoordMode "Pixel", "Window" | |
CoordMode "Mouse", "Window" | |
HWNDs := WinGetList("ahk_exe RobloxPlayerBeta.exe") | |
; used by the automatic enchantment rolling, stops rolling once the "colour" is found in the enchant window | |
wantsMimics := true | |
wantsSecretAgents := false | |
wantsStarGazers := false | |
wantsPetLuck := false | |
; coords | |
; different screens have different DPI so the coords can change | |
; window should be as small as Roblox client allows | |
; pet enchantment search area | |
SEARCH_AREA_X := 526 | |
SEARCH_AREA_Y := 236 | |
SEARCH_AREA_X2 := 720 | |
SEARCH_AREA_Y2 := 262 | |
; enchantment button location | |
ENCHANT_CLICK_POS_X := 578 | |
ENCHANT_CLICK_POS_Y := 507 | |
; empty scren location where to click to throw | |
THROW_CLICK_POS_X := 628 | |
THROW_CLICK_POS_Y := 534 | |
; chat area where to move the mouse to, if you want to see what eggs are being found | |
CHAT_AREA_POS_X := 223 | |
CHAT_AREA_POS_Y := 150 | |
; top left and bottom right of open/close throw screen button (viewing the thrown characters) | |
THROW_SCREEN_CLOSE_POS_X := 452 | |
THROW_SCREEN_CLOSE_POS_Y := 530 | |
THROW_SCREEN_CLOSE_POS_X2 := 468 | |
THROW_SCREEN_CLOSE_POS_Y2 := 549 | |
; location of the robux buy window if it appears during enchanting | |
BUY_WINDOW_POS_X := 180 | |
BUY_WINDOW_POS_Y := 140 | |
BUY_WINDOW_POS_X2 := 660 | |
BUY_WINDOW_POS_Y2 := 500 | |
; not used but was meant to be for finding if the enchant window was open | |
ENCHANT_WINDOW_TITLE_POS_X := 450 | |
ENCHANT_WINDOW_TITLE_POS_Y := 108 | |
ENCHANT_WINDOW_TITLE_POS_X2 := 683 | |
ENCHANT_WINDOW_TITLE_POS_Y2 := 157 | |
; doesn't work, was meant for auto enchanting to level 5 but it's easy enough so not sure if this will be developed further | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X := 633 | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y := 323 | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X2 := 635 | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y2 := 333 | |
; for monitoring the rocket boost bar and when to auto switch to another team | |
NO_MORE_BOOST_POS_X := 404 | |
NO_MORE_BOOST_POS_Y := 641 | |
; for clicking the spin button on the wheel screen | |
SPIN_POS_X := 401 | |
SPIN_POS_Y := 510 | |
; colours | |
; _GREYED means when the robux purchase screen is open, sometimes it gets stuck on screen and greys the screen | |
; if HDR is on it might affect what colours need to be selected | |
SA_PINK := 0xFF1ACC | |
SA_ORANGE := 0xFF764A | |
SA_PINK_GREYED := 0x660855 | |
SA_ORANGE_GREYED := 0x663614 | |
; colours of enchants | |
; mimic has two main colours to search for, pink and blue | |
MIMIC_PINK := 0xFA37E8 | |
MIMIC_BLUE := 0x3189FF | |
MIMIC_PINK_GREYED := 0x64165D | |
MIMIC_BLUE_GREYED := 0x143C66 | |
; stargazer is orange only | |
STARGAZER_ORANGE := 0xEB7E28 | |
STARGAZER_ORANGE_GREYED := 0x5C310F | |
; pet luck is green only | |
PET_LUCK_GREEN := 0x39BB31 | |
PET_LUCK_GREEN_GREYED := 0x195216 | |
; doesn't work, was meant for auto enchanting to level 5 | |
UPGRADE_RED := 0xE13836 | |
UPGRADE_RED_GREYED := 0x5A1616 | |
; for monitoring if the throw screen is open or closed, as to whether to click the button or not | |
THROW_SCREEN_CLOSE_BUTTON_COLOR := 0x00FF36 | |
THROW_SCREEN_CLOSE_BUTTON_COLOR_GREYED := 0x2A5E1E | |
THROW_SCREEN_CLOSED_BUTTON_COLOR := 0xFF758A | |
THROW_SCREEN_CLOSED_BUTTON_COLOR_GREYED := 0x5E1D1D | |
ThrowScreenIsOpen(&Px, &Py) { | |
Return PixelSearch( | |
&Px, | |
&Py, | |
THROW_SCREEN_CLOSE_POS_X, | |
THROW_SCREEN_CLOSE_POS_Y, | |
THROW_SCREEN_CLOSE_POS_X2, | |
THROW_SCREEN_CLOSE_POS_Y2, | |
THROW_SCREEN_CLOSE_BUTTON_COLOR, | |
50 | |
) OR PixelSearch( | |
&Px, | |
&Py, | |
THROW_SCREEN_CLOSE_POS_X, | |
THROW_SCREEN_CLOSE_POS_Y, | |
THROW_SCREEN_CLOSE_POS_X2, | |
THROW_SCREEN_CLOSE_POS_Y2, | |
THROW_SCREEN_CLOSE_BUTTON_COLOR_GREYED, | |
50 | |
) ; | |
} | |
ThrowingWithClosedThrowScreen() { | |
Return PixelSearch( | |
&Px, | |
&Py, | |
THROW_SCREEN_CLOSE_POS_X, | |
THROW_SCREEN_CLOSE_POS_Y, | |
THROW_SCREEN_CLOSE_POS_X2, | |
THROW_SCREEN_CLOSE_POS_Y2, | |
THROW_SCREEN_CLOSED_BUTTON_COLOR, | |
50 | |
) or PixelSearch( | |
&Px, | |
&Py, | |
THROW_SCREEN_CLOSE_POS_X, | |
THROW_SCREEN_CLOSE_POS_Y, | |
THROW_SCREEN_CLOSE_POS_X2, | |
THROW_SCREEN_CLOSE_POS_Y2, | |
THROW_SCREEN_CLOSED_BUTTON_COLOR_GREYED, | |
50 | |
) ; | |
} | |
NoMoreBoost() { | |
Return PixelSearch( | |
&Px, | |
&Py, | |
NO_MORE_BOOST_POS_X, | |
NO_MORE_BOOST_POS_Y, | |
NO_MORE_BOOST_POS_X + 1, | |
NO_MORE_BOOST_POS_Y + 1, | |
0x000000, | |
0 | |
) ; | |
} | |
CloseThrowScreen() { | |
if ThrowScreenIsOpen(&Px, &Py) { | |
MouseMove Px, Py ; | |
Sleep 1 ; | |
MouseClick "Left", Px, Py + 1 ; | |
Sleep 1000 ; | |
} | |
} | |
PetMenuIsOpen() { | |
Return ImageSearch( | |
&TopLeftFoundImageX, | |
&TopLeftFoundImageY, | |
0, | |
0, | |
1008, | |
594, | |
"pets.png" | |
) ; | |
} | |
OpenPetsMenu() { | |
if !PetMenuIsOpen() { | |
MouseMove 884, 427 ; | |
Sleep 1 ; | |
MouseClick "Left", 884, 427 + 1 ; | |
Sleep 1 ; | |
} | |
} | |
ClosePetsMenu() { | |
if PetMenuIsOpen() { | |
MouseMove 953, 200 ; | |
Sleep 1 ; | |
MouseClick "Left", 953, 200 + 1 ; | |
Sleep 1 ; | |
} | |
} | |
TeamsMenuIsOpen() { | |
Return ImageSearch( | |
&TopLeftFoundImageX, | |
&TopLeftFoundImageY, | |
0, | |
0, | |
1008, | |
594, | |
"*8 create.png" | |
) ; | |
} | |
OpenTeamsMenu() { | |
if !TeamsMenuIsOpen() { | |
if ImageSearch(&TopLeftFoundImageX, &TopLeftFoundImageY, 0, 0, 1008, 594, "*8 teams.png") { | |
MouseMove TopLeftFoundImageX, TopLeftFoundImageY ; | |
Sleep 1 ; | |
MouseClick "Left", TopLeftFoundImageX, TopLeftFoundImageY + 1 ; | |
Sleep 1 ; | |
} | |
} | |
} | |
GetTeamPos(&Px, &Py, team) { | |
Return ImageSearch(&Px, &Py, 592, 263, 888, 553, Format("*10 {:}.png", team)) ; | |
} | |
selectedTeam := "" | |
SelectTeam(team) { | |
global selectedTeam ; | |
if selectedTeam == team { | |
Return ; | |
} | |
OpenPetsMenu() ; | |
Sleep 1000 ; | |
OpenTeamsMenu() ; | |
Sleep 1000 ; | |
if GetTeamPos(&Px, &Py, team) { | |
if PixelSearch(&TopLeftFoundImageX, &TopLeftFoundImageY, Px - 5, Py - 5, 1008, 594, 0x54F350, 5) { | |
MouseMove TopLeftFoundImageX + 5, TopLeftFoundImageY + 5 ; | |
Sleep 1 ; | |
MouseClick "Left", TopLeftFoundImageX + 6, TopLeftFoundImageY + 6 ; | |
} | |
} | |
Sleep 1000 ; | |
ClosePetsMenu() ; | |
selectedTeam := team ; | |
} | |
EnchantWindowIsOpen(&TopLeftFoundImageX, &TopLeftFoundImageY) { | |
Return ImageSearch(&TopLeftFoundImageX, &TopLeftFoundImageY, ENCHANT_WINDOW_TITLE_POS_X, ENCHANT_WINDOW_TITLE_POS_Y, ENCHANT_WINDOW_TITLE_POS_X2, ENCHANT_WINDOW_TITLE_POS_Y2, "enchant_window.png") ; | |
} | |
BuyWindowIsOpen(&TopLeftFoundImageX, &TopLeftFoundImageY) { | |
Return ImageSearch( | |
&TopLeftFoundImageX, | |
&TopLeftFoundImageY, | |
BUY_WINDOW_POS_X, | |
BUY_WINDOW_POS_Y, | |
BUY_WINDOW_POS_X2, | |
BUY_WINDOW_POS_Y2, | |
"cancel.png" | |
) ; | |
} | |
CloseBuyWindow() { | |
if BuyWindowIsOpen(&TopLeftFoundImageX, &TopLeftFoundImageY) { | |
MouseMove TopLeftFoundImageX, TopLeftFoundImageY ; | |
Sleep 10 ; | |
MouseClick "Left", TopLeftFoundImageX, TopLeftFoundImageY + 1 ; | |
Sleep 2000 ; | |
} | |
} | |
PetHasEnchantColour(colour) { | |
Return PixelSearch(&Px, &Py, SEARCH_AREA_X, SEARCH_AREA_Y, SEARCH_AREA_X2, SEARCH_AREA_Y2, colour, 10) ; | |
} | |
IsUpgradeScreen() { | |
Return ImageSearch( | |
&TopLeftFoundImageX, | |
&TopLeftFoundImageY, | |
ENCHANT_WINDOW_TITLE_POS_X, | |
ENCHANT_WINDOW_TITLE_POS_Y, | |
ENCHANT_WINDOW_TITLE_POS_X2, | |
ENCHANT_WINDOW_TITLE_POS_Y2, | |
"upgrade.png" | |
) or ImageSearch( | |
&TopLeftFoundImageX, | |
&TopLeftFoundImageY, | |
ENCHANT_WINDOW_TITLE_POS_X, | |
ENCHANT_WINDOW_TITLE_POS_Y, | |
ENCHANT_WINDOW_TITLE_POS_X2, | |
ENCHANT_WINDOW_TITLE_POS_Y2, | |
"upgrade_grayed.png" | |
) ; | |
} | |
IsEnchantLevel5OrAbove() { | |
Return PixelSearch( | |
&Px, | |
&Py, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X2, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y2, | |
UPGRADE_RED, | |
5 | |
) or PixelSearch( | |
&Px, | |
&Py, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_X2, | |
UPGRADE_WINDOW_FAIL_BAR_POS_LEVEL5_Y2, | |
UPGRADE_RED_GREYED, | |
5 | |
) ; | |
} | |
IsPetLuck() { | |
Return PetHasEnchantColour(PET_LUCK_GREEN) or PetHasEnchantColour(PET_LUCK_GREEN_GREYED) ; | |
} | |
IsMimic() { | |
Return ( | |
PetHasEnchantColour(MIMIC_PINK) and PetHasEnchantColour(MIMIC_BLUE) | |
) or ( | |
PetHasEnchantColour(MIMIC_PINK_GREYED) and PetHasEnchantColour(MIMIC_BLUE_GREYED) | |
) ; | |
} | |
IsSecretAgent() { | |
Return ( | |
PetHasEnchantColour(SA_PINK) and PetHasEnchantColour(SA_ORANGE) | |
) or ( | |
PetHasEnchantColour(SA_PINK_GREYED) and PetHasEnchantColour(SA_ORANGE_GREYED) | |
) ; | |
} | |
IsStarGazer() { | |
Return PetHasEnchantColour(STARGAZER_ORANGE) or PetHasEnchantColour(STARGAZER_ORANGE_GREYED) ; | |
} | |
IsWantedEnchant() | |
{ | |
CloseBuyWindow() ; | |
Return ( | |
wantsSecretAgents and IsSecretAgent() | |
) or ( | |
wantsMimics and IsMimic() | |
) or ( | |
wantsStarGazers and IsStarGazer() | |
) or ( | |
wantsPetLuck and IsPetLuck() | |
) ; | |
} | |
ClickEnchantButton(active_window_id:=0) { | |
; Safeguard rare enchants | |
for window_id in HWNDs { | |
WinActivate "ahk_id" window_id ; | |
if !IsWantedEnchant() { | |
MouseMove ENCHANT_CLICK_POS_X, ENCHANT_CLICK_POS_Y ; | |
Sleep 1 ; | |
MouseClick "Left", ENCHANT_CLICK_POS_X, ENCHANT_CLICK_POS_Y + 1 ; | |
Sleep 1 ; | |
} | |
} | |
if active_window_id != 0 { | |
WinActivate "ahk_id" active_window_id ; | |
} | |
Sleep 25 ; | |
} | |
ClickUpgradeButton() { | |
; Safeguard rare enchants | |
for window_id in HWNDs { | |
WinActivate "ahk_id" window_id ; | |
if IsEnchantLevel5OrAbove() { | |
Continue ; | |
} | |
MouseMove ENCHANT_CLICK_POS_X, ENCHANT_CLICK_POS_Y ; | |
Sleep 1 ; | |
MouseClick "Left", ENCHANT_CLICK_POS_X, ENCHANT_CLICK_POS_Y + 1 ; | |
Sleep 1 ; | |
} | |
} | |
Yeet(changeTeams:=false) { | |
if !ThrowingWithClosedThrowScreen() { | |
if changeTeams { | |
SelectTeam("rocket") ; | |
} | |
MouseMove THROW_CLICK_POS_X, THROW_CLICK_POS_Y ; | |
Sleep 10 ; | |
MouseClick "Left", THROW_CLICK_POS_X, THROW_CLICK_POS_Y + 1 ; | |
Sleep 1000 ; | |
CloseThrowScreen() ; | |
} | |
} | |
AutoFarmStarsEnergyAndEnchants(enchant, changeTeams) { | |
Loop { | |
for window_id in HWNDs { | |
WinActivate "ahk_id" window_id ; | |
if enchant { | |
ClickEnchantButton(window_id) ; | |
} else { | |
if changeTeams { | |
if NoMoreBoost() { | |
SelectTeam("energy") ; | |
} | |
else { | |
SelectTeam("power") ; | |
} | |
} | |
} | |
Send "{w down}" ; | |
Send "{Space down}" ; | |
Sleep 4000 ; | |
Send "{Space up}" | |
Sleep 2000 ; | |
Send "{w up}" ; | |
Yeet(!enchant and changeTeams) ; | |
if enchant { | |
ClickEnchantButton(window_id) ; | |
} | |
else { | |
if changeTeams { | |
if NoMoreBoost() { | |
SelectTeam("energy") ; | |
} | |
else { | |
SelectTeam("power") ; | |
} | |
} | |
} | |
Send "{s down}" ; | |
Send "{Space down}" ; | |
Sleep 4000 ; | |
Send "{Space up}" | |
Sleep 2000 ; | |
Send "{s up}" ; | |
if NoMoreBoost() and changeTeams { | |
SelectTeam("energy") ; | |
} | |
Sleep 25 ; | |
} | |
} | |
} | |
F2:: { | |
Pause True ; | |
Suspend True ; | |
Reload ; | |
} ; | |
F3:: { | |
Yeet() ; | |
; if IsWantedEnchant() { | |
; MsgBox "Detected a rare enchant colour pair" ; | |
; Return ; | |
; } | |
; MsgBox "Did not detect any rare enchant" ; | |
} | |
; auto farm stars and energy | |
F4:: { | |
AutoFarmStarsEnergyAndEnchants(false, false) ; | |
} ; | |
; auto farm stars, energy, and mimic | |
F5:: { | |
AutoFarmStarsEnergyAndEnchants(true, false) ; | |
} ; | |
; auto open eggs quickly | |
F6:: { | |
Loop { | |
for window_id in HWNDs { | |
WinActivate "ahk_id" window_id ; | |
if BuyWindowIsOpen(&TopLeftFoundImageX, &TopLeftFoundImageY) { | |
Continue ; | |
} | |
MouseMove CHAT_AREA_POS_X, CHAT_AREA_POS_Y ; | |
Sleep 10 ; | |
MouseMove THROW_CLICK_POS_X, THROW_CLICK_POS_Y - 1 ; | |
Send "{r down}" ; | |
Sleep 5 ; | |
Send "{r up}" ; | |
Loop 20 { | |
MouseClick "Left", THROW_CLICK_POS_X, THROW_CLICK_POS_Y ; | |
Sleep 25 ; | |
} | |
} | |
Sleep 500 ; | |
} | |
} ; | |
; Roll for enchants | |
F7:: { | |
Loop { | |
ClickEnchantButton() ; | |
Sleep 5000 ; | |
} | |
} ; | |
; Upgrade to level 5 | |
F8:: { | |
if IsEnchantLevel5OrAbove() { | |
MsgBox "is level 5 or above" | |
} | |
} ; | |
; Spin wheels | |
F9:: { | |
Loop { | |
for window_id in HWNDs { | |
WinActivate "ahk_id" window_id ; | |
MouseMove SPIN_POS_X, SPIN_POS_Y ; | |
MouseClick "Left", SPIN_POS_X, SPIN_POS_Y ; | |
Sleep 5 ; | |
} | |
} | |
} ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment