Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Cleaning up Unlimited Summon support
Browse files Browse the repository at this point in the history
  • Loading branch information
www committed Jan 1, 2024
1 parent 5d00646 commit badfceb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
10 changes: 5 additions & 5 deletions AutoAFK.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
latest_release = 'Cannot retrieve!'


version = "0.12.1b"
version = "0.12.2"

#Main Window
class App(customtkinter.CTk):
Expand Down Expand Up @@ -171,7 +171,7 @@ def __init__(self):
self.textbox.insert('end', 'Discord Server: ', 'purple')
self.textbox.insert('end', 'discord.gg/floofpire in #auto-afk\n\n')
if latest_release.split(' ')[1] != version and latest_release.split(' ')[1] != 'retrieve!':
self.textbox.insert('end', 'Newer version available (' + latest_release.split(' ')[1] + '), please update!\n\n', 'yellow')
self.textbox.insert('end', 'Newer version available (' + latest_release.split(' ')[1] + '), please update!\n', 'yellow')
if (args['config']) != 'settings.ini':
self.textbox.insert('end', (args['config']) + ' loaded\n\n', 'yellow')
if not args['dailies']:
Expand Down Expand Up @@ -537,7 +537,7 @@ def __init__(self, *args, **kwargs):
self.geometry("200x260")
self.title('Unlimited Summons')
self.attributes("-topmost", True)
self.wm_iconbitmap(cwd + 'img\\auto.ico')
self.wm_iconbitmap(os.path.join(cwd, 'img', 'auto.ico'))

# Activity Frame
self.summonsFrame = customtkinter.CTkFrame(master=self, width=180, height=250)
Expand All @@ -551,7 +551,7 @@ def __init__(self, *args, **kwargs):
self.wokeDropdown = customtkinter.CTkComboBox(master=self.summonsFrame, values=['Awakened Talene', 'Awakened Athalia',
'Gavus', 'Maetria', 'Awakened Ezizh', 'Awakened Thane', 'Awakened Belinda', 'Awakened Brutus', 'Awakened Safiya',
'Awakened Solise', 'Awakened Lyca', 'Awakened Baden', 'Awakened Shemira'], width=160)
self.wokeDropdown(state='readonly')
self.wokeDropdown.configure(state='readonly')
self.wokeDropdown.place(x=10, y=70)

self.celehypoLabel = customtkinter.CTkLabel(master=self.summonsFrame, text='Desired CeleHypo:', fg_color=("gray86", "gray17"))
Expand All @@ -560,7 +560,7 @@ def __init__(self, *args, **kwargs):
self.celehypoDropdown = customtkinter.CTkComboBox(master=self.summonsFrame, values=['Audrae', 'Canisa and Ruke',
'Daemia', 'Ezizh', 'Khazard', 'Lavatune', 'Liberta', 'Lucilla', 'Lucretia', 'Mehira', 'Mortas', 'Olgath', 'Talene',
'Tarnos', 'Elijah and Lailah', 'Veithal', 'Vyloris', 'Zaphrael', 'Zikis'], width=160)
self.celehypoDropdown(state='readonly')
self.celehypoDropdown.configure(state='readonly')
self.celehypoDropdown.place(x=10, y=130)

self.x6Checkbox = customtkinter.CTkCheckBox(master=self.summonsFrame, text='x6 Speed Mode', onvalue=True, offvalue=False)
Expand Down
28 changes: 18 additions & 10 deletions activities.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import math

from tools import *
from AutoAFK import printGreen, printError, printWarning, printBlue, printPurple, settings
import datetime
Expand Down Expand Up @@ -703,6 +705,8 @@ def handleCircusTour(battles = 3):

def infiniteSummons(woke, celehypo, x6mode=False):
printBlue('Attempting to run Unlimited Summons')
counter = 0 # Pull amount counter
starttime = time.time() # Pull duration counter
if isVisible('buttons/summons/summons_sidebar', retry=3, click=True):
# List to match the dropdown name to the image file name
wokes = {'Awakened Talene': 'aTalene', 'Gavus': 'Gavus', 'Maetria': 'Maetria', 'Awakened Ezizh': 'aEzizh',
Expand All @@ -718,41 +722,45 @@ def infiniteSummons(woke, celehypo, x6mode=False):
search = True
printGreen('Searching for: ' + woke + ' and ' + celehypo)
print('')
clickXY(125, 850)
clickXY(700, 1700, seconds=2)
clickXY(700, 1700, seconds=2) # Click 'Summon Again'
while search is True:
# Self-explanatory, if x6 mode is enabled we click a little faster
if x6mode is False:
if x6mode is False: # Self-explanatory, if x6 mode is enabled we click a little faster, else slower
clickXY(680, 1820, seconds=2)
clickXY(950, 1820)
clickXY(950, 1820)
wait(6)
else:
clickXY(680, 1820)
clickXY(950, 1820, seconds=0.5)
clickXY(950, 1820, seconds=0.5)
clickXY(950, 1820, seconds=0.3)
clickXY(950, 1820, seconds=0.3)
wait(2)
# return Awakened, Epic or Rare
found = str(returnCardPullsRarity())
counter += 1
if found == "Awakened":
printWarning('Awakened Found')
if isVisible('\\summons\\awakeneds\\' + wokes[woke], confidence=0.85):
# Let's check if it's the one we want
if isVisible(os.path.join('summons', 'awakeneds', wokes[woke]), confidence=0.85, seconds=0.5):
printGreen(' ' + woke + ' found! Checking for ' + celehypo)
if isVisible('\\summons\\celehypos\\' + celehypos[celehypo], confidence=0.85):
# If it is we then check the celeypo
if isVisible(os.path.join('summons', 'celehypos', celehypos[celehypo]), confidence=0.85):
printGreen(' ' + celehypo + ' found too! Recording Summon and exiting..')
click('buttons/summons/record', confidence=0.85, retry=3, seconds=3)
click('buttons/summons/change', confidence=0.85, retry=3, seconds=3, suppress=True) # Suppress as this isn't always present
click('buttons/summons/confirm', confidence=0.85, retry=3, seconds=3)
search = False
else:
printError(' ' + celehypo + ' not found, continuing..')
# save_screenshot('woke_' + str((random.randrange(1,1000))))
if found == 'Epic':
printPurple('Epic Found')
# save_screenshot('epic_' + str((random.randrange(1,1000))))
if found == 'Rare':
printBlue('Rare found')
# Funky math for duration calculation, ceiling is used to roundup else it returns with a decimal place
duration = time.time() - starttime
hours = str(math.ceil(duration // 3600))
minutes = str(math.ceil(duration // 60))
printGreen('Unlimited Summons finished!')
printGreen('In just ' + str(counter) + ' pulls and ' + hours + ' hours ' + minutes + ' minutes. Hooray!')
else:
# If we can't find the Unlimited Summons button we end
printError('Could not find Unlimited Summons button..')
Expand Down
4 changes: 2 additions & 2 deletions settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ twistedrealm = False
collectquests = True
collectmerchants = True
shoprefreshes = 2
fightoffates = True
circustour = True
fightoffates = False
circustour = False

[ACTIVITY]
activitybattles = 50
Expand Down
4 changes: 2 additions & 2 deletions tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def waitUntilGameActive():

while loadingcounter < loaded:
clickXY(550, 1850)
buttons = ['buttons/campaign_unselected', 'buttons/exitmenu_trial']
buttons = [os.path.join('buttons', 'campaign_unselected'), os.path.join('buttons', 'exitmenu_trial')]
for button in buttons:
click(button, seconds=0, suppress=True)
timeoutcounter += 1
Expand Down Expand Up @@ -342,7 +342,7 @@ def pixelCheck(x,y,c,seconds=1):

def returnCardPullsRarity():
take_screenshot(device)
screenshot = asarray(Image.open(cwd + 'screen.bin')) # Convert PIL Image to NumPy Array for tuples
screenshot = asarray(Image.open(os.path.join(cwd, 'screen.bin'))) # Convert PIL Image to NumPy Array for tuples
cards = {'1': [95, 550], '2': [95, 900], '3': [95, 1350], '4': [410, 250], '5': [410, 650], '6': [410, 1100], '7': [410, 1550], '8': [729, 550], '9': [729, 900], '10': [729, 1350]}

for card, location in cards.items(): # screenshot[] searchs Y first then X for reasons, so the locations[] are reversed
Expand Down

0 comments on commit badfceb

Please sign in to comment.