Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions AutoAFK2.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ def emit(self, record):
"Run Quests",
"Use Dream Realm attempts",
"Farm Team-Up Chat",
"Farm Chain AFK Proxy Request",
"Farm Chain AFK Proxy Request (Normal AFK stages)",
"Farm Chain AFK Proxy Request (Talent stages)",
]
selection = SelectionMenu.get_selection(
options,
Expand Down Expand Up @@ -269,13 +270,20 @@ def emit(self, record):
bot.team_up()

if selection == 9:
logger.info("Starting up Chain Proxy farming")
logger.info("Starting up Chain Proxy farming (Normal AFK stages)")
logger.info(
"For this function you need to open the request yourself and start this function at the stage setup screen\n"
)

bot.afk_stage_chain_proxy()
bot.afk_stage_chain_proxy("afk")

if selection == 10:
logger.info("Starting up Chain Proxy farming (Talent stages)")
logger.info(
"For this function you need to open the request yourself and start this function at the stage setup screen\n"
)

bot.afk_stage_chain_proxy("talent")

if __name__ == "__main__":
main()
13 changes: 11 additions & 2 deletions automation/afkj_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,14 +1653,23 @@ def open_afk_stages(self, afkstages: bool = True) -> None:
self.click_xy(370, 1600, seconds=2) # AFK Stage button
self.click("buttons/confirm", suppress=True)

def afk_stage_chain_proxy(self) -> None:
def afk_stage_chain_proxy(self, stage_type: str) -> None:
"""Starts an AFK Stage chain by attempting to start the stage and then
automatically retrying upon defeat. The method changes formations after
a specified number of defeats, as configured.

This method is a proxy to the `blind_push` method with the "afkstages"
argument set to True. It is intended to be used for convenience.
"""

if stage_type == "afk":
button = "buttons/battle"
elif stage_type == "talent":
button = "buttons/talent_trials"
else:
self.logger.info("Invalid stage type provided!")
return

self.formation_handler()
self.click(
"buttons/battle",
Expand All @@ -1674,7 +1683,7 @@ def afk_stage_chain_proxy(self) -> None:
# Victory Logic
if self.is_visible("buttons/next", retry=1, click=True, seconds=3):
self.click(
"buttons/battle",
button,
retry=1,
suppress=True,
seconds=5,
Expand Down