3131 'ApexDir' : r'C:\Program Files\EA Games\Apex\\r5apex.exe' ,
3232 'OCR_debug' : '0' ,
3333 'show_exp' : '1' ,
34+ 'Gamemode' : 'Trios' ,
3435 'Champion' : 'Lifeline' }
3536 config ['KEYBINDS' ] = {'Crouch_Key' : 'c' ,
3637 'Heal_Key' : '4' ,
5455OCR_debug = int (config .get ('CONFIG' , 'OCR_debug' ))
5556show_exp = int (config .get ('CONFIG' , 'show_exp' ))
5657champion = str (config .get ('CONFIG' , 'Champion' ))
58+ gamemode = str (config .get ('CONFIG' , 'Gamemode' ))
5759
5860crouch_key = str (config .get ('KEYBINDS' , 'Crouch_Key' ))
5961heal_key = str (config .get ('KEYBINDS' , 'Heal_Key' ))
153155print ("CONFIG: -> | Apex Directory: | >>>" , apexdir )
154156print ("CONFIG: -> | Show earned XP: | >>>" , show_exp )
155157print ("CONFIG: -> | Champion | >>>" , champion )
158+ print ("CONFIG: -> | Gamemode | >>>" , gamemode )
156159print ("CONFIG: -> | DEBUG MODE: | >>>" , OCR_debug )
157160print (" ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ " )
158161print ('' )
159162print ('' )
160163print ('' )
161164print ('' )
162165print ('' )
166+ print ('' )
163167print ("Press any key to continue if settings are correct" )
164168msvcrt .getch ()
165169print (UP , end = CLEAR )
@@ -269,7 +273,7 @@ def process_exists(process_name):
269273 pyautogui .press ("alt" )
270274 win32gui .SetForegroundWindow (apex_hwnd )
271275 win32gui .SetActiveWindow (apex_hwnd )
272- while gamemode_set == 1 :
276+ while ( gamemode_set == 1 ) and ( gamemode == 'Duos' ) :
273277
274278 try :
275279 coords_gamemode_x , coords_gamemode_y = pyautogui .locateCenterOnScreen (resource_path ('ss\\ trios.png' ),region = (gamemode_coords ),confidence = 0.9 )
@@ -294,7 +298,18 @@ def process_exists(process_name):
294298 pyautogui .moveTo (200 ,100 )
295299 gamemode_set = 0
296300
297- if (pyautogui .locateOnScreen (resource_path ('ss\\ team.png' ), region = (team_coords ), grayscale = True , confidence = 0.9 ) != None ) and (pyautogui .locateOnScreen (resource_path ('ss\\ duos.png' ), region = (gamemode_coords ), grayscale = True , confidence = 0.9 ) != None ):
301+ if (pyautogui .locateOnScreen (resource_path ('ss\\ team.png' ), region = (team_coords ), grayscale = True , confidence = 0.9 ) != None ) and (pyautogui .locateOnScreen (resource_path ('ss\\ duos.png' ), region = (gamemode_coords ), grayscale = True , confidence = 0.7 ) != None ):
302+ try :
303+ coords_auto_fill_x , coords_auto_fill_y = pyautogui .locateCenterOnScreen (resource_path ('ss\\ team.png' ),region = (team_coords ),confidence = 0.9 )
304+ except TypeError :
305+ coords_auto_fill_x = 0
306+ coords_auto_fill_y = 0
307+ if (coords_auto_fill_x != 0 ) and (coords_auto_fill_y != 0 ):
308+ pyautogui .moveTo (coords_auto_fill_x ,coords_auto_fill_y )
309+ pyautogui .click (coords_auto_fill_x ,coords_auto_fill_y )
310+ time .sleep (2 )
311+ pyautogui .moveTo (200 ,100 )
312+ elif (pyautogui .locateOnScreen (resource_path ('ss\\ team.png' ), region = (team_coords ), grayscale = True , confidence = 0.9 ) != None ) and (pyautogui .locateOnScreen (resource_path ('ss\\ trios.png' ), region = (gamemode_coords ), grayscale = True , confidence = 0.7 ) != None ):
298313 try :
299314 coords_auto_fill_x , coords_auto_fill_y = pyautogui .locateCenterOnScreen (resource_path ('ss\\ team.png' ),region = (team_coords ),confidence = 0.9 )
300315 except TypeError :
@@ -318,15 +333,15 @@ def process_exists(process_name):
318333
319334 #program loop
320335 while mod == 3 :
321- if pyautogui .locateOnScreen (resource_path ('ss\\ trios.png' ), region = (gamemode_coords ), grayscale = True , confidence = 0.9 ) != None :
336+ if pyautogui .locateOnScreen (resource_path ('ss\\ trios.png' ), region = (gamemode_coords ), grayscale = True , confidence = 0.7 ) != None :
322337 gamemode_set = 1
323338 apex_hwnd = win32gui .FindWindow (None ,'Apex Legends' )
324339 if apex_hwnd != 0 :
325340 time .sleep (1 )
326341 pyautogui .press ("alt" )
327342 win32gui .SetForegroundWindow (apex_hwnd )
328343 win32gui .SetActiveWindow (apex_hwnd )
329- while gamemode_set == 1 :
344+ while ( gamemode_set == 1 ) and ( gamemode == 'Duos' ) :
330345
331346 try :
332347 coords_gamemode_x , coords_gamemode_y = pyautogui .locateCenterOnScreen (resource_path ('ss\\ trios.png' ),region = (gamemode_coords ),confidence = 0.9 )
@@ -867,7 +882,3 @@ def process_exists(process_name):
867882 if (pyautogui .locateOnScreen (resource_path ('ss\\ leader.png' ), region = (398 ,140 ,334 ,71 ), confidence = 0.8 ) != None ) or (pyautogui .locateOnScreen (resource_path ('ss\\ leader.png' ), region = (1187 ,147 ,244 ,95 ), confidence = 0.8 ) != None ):
868883 mod = 3
869884
870-
871-
872-
873-
0 commit comments