Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### Cliclick is needed to run the scripts, and that is only available on macOS.

# Get current python image
FROM python:3.12.11-bullseye
FROM python:3.13.6-bullseye

# Update image
RUN apt-get update && apt-get upgrade -y
Expand Down
3 changes: 3 additions & 0 deletions Point.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from collections import namedtuple

Point = namedtuple("Point", ["x", "y"])
30 changes: 15 additions & 15 deletions battler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import sys

# Custom imports
import config
from configs.iPhone11 import coordinates
from functions.cliclick import Cliclick
import functions.utils as utils

Expand Down Expand Up @@ -63,20 +63,20 @@
sys.exit("ERROR: must specify one of --great, --ultra, or --master")

# Access the coordinates from the active system
lets_do_it_coordinates = config.SETTINGS["lets_do_it_coordinates"]
start_battle_coordinates = config.SETTINGS["start_battle_coordinates"]
great_league_coordinates = config.SETTINGS["great_league_coordinates"]
ultra_league_coordinates = config.SETTINGS["ultra_league_coordinates"]
master_league_coordinates = config.SETTINGS["master_league_coordinates"]
lets_battle_coordinates = config.SETTINGS["lets_battle_coordinates"]
use_party_coordinates = config.SETTINGS["use_party_coordinates"]
rematch_coordinates = config.SETTINGS["rematch_coordinates"]
first_pokemon_in_party_coordinates = config.SETTINGS["first_pokemon_in_party_coordinates"]
first_pokemon_coordinates = config.SETTINGS["first_pokemon_coordinates"]
second_pokemon_coordinates = config.SETTINGS["second_pokemon_coordinates"]
third_pokemon_coordinates = config.SETTINGS["third_pokemon_coordinates"]
done_button_coordinates = config.SETTINGS["done_button_coordinates"]
change_prng = config.SETTINGS["change_prng"]
lets_do_it_coordinates = coordinates["lets_do_it_coordinates"]
start_battle_coordinates = coordinates["start_battle_coordinates"]
great_league_coordinates = coordinates["great_league_coordinates"]
ultra_league_coordinates = coordinates["ultra_league_coordinates"]
master_league_coordinates = coordinates["master_league_coordinates"]
lets_battle_coordinates = coordinates["lets_battle_coordinates"]
use_party_coordinates = coordinates["use_party_coordinates"]
rematch_coordinates = coordinates["rematch_coordinates"]
first_pokemon_in_party_coordinates = coordinates["first_pokemon_in_party_coordinates"]
first_pokemon_coordinates = coordinates["first_pokemon_coordinates"]
second_pokemon_coordinates = coordinates["second_pokemon_coordinates"]
third_pokemon_coordinates = coordinates["third_pokemon_coordinates"]
done_button_coordinates = coordinates["done_button_coordinates"]
change_prng = coordinates["change_prng"]

pixel_randomness = 10

Expand Down
67 changes: 0 additions & 67 deletions config.py

This file was deleted.

Empty file added configs/__init__.py
Empty file.
131 changes: 131 additions & 0 deletions configs/iPhone11.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
"""
This is a config file for screen mirroring with an iPhone 11 with a "Larger" view window.
To use this with an iPhone 11, the only thing you should modify is the `anchor` variable.
"""

from Point import Point

# Red 'x' in the top left of the mirroring window
anchor = Point(1311, 213) # MacBook Air

# Individual offset values with a "larger" view
# iPhone Mirroring -> View -> Larger
start_battle_offset = Point(286, 633)
start_trade_offset = Point(129, 636)
first_trade_pokemon_offset = Point(55, 276)
between_first_second_pokemon_offset = Point(109, 275) # unused
next_button_offset = Point(176, 704)
confirm_button_offset = Point(36, 437)
pokemon_details_left_health_white_offset = Point(39, 366) # unused
x_button_offset = Point(175, 782)
start_drag_next_poke_offset = Point(322, 497)
end_drag_next_poke_offset = Point(29, 497)
modify_favorite_offset = Point(325, 81)
lets_do_it_offset = Point(172, 515)
great_league_offset = Point(174, 391)
ultra_league_offset = Point(175, 507)
master_league_offset = Point(176, 628)
lets_battle_offset = Point(171, 506)
first_pokemon_in_party_offset = Point(73, 615)
use_party_offset = Point(188, 746)
rematch_offset = Point(171, 537)
sort_button_offset = Point(310, 702) # unused
first_pokemon_offset = Point(56, 353)
second_pokemon_offset = Point(174, 353)
third_pokemon_offset = Point(291, 353)
done_button_offset = Point(260, 796)

# Recreated configuration using anchor + individual offsets
coordinates = {
"start_battle_coordinates": [
anchor.x + start_battle_offset.x,
anchor.y + start_battle_offset.y,
],
"start_trade_coordinates": [
anchor.x + start_trade_offset.x,
anchor.y + start_trade_offset.y,
],
"first_trade_pokemon_coordinates": [
anchor.x + first_trade_pokemon_offset.x,
anchor.y + first_trade_pokemon_offset.y,
],
"between_first_second_pokemon": [
anchor.x + between_first_second_pokemon_offset.x,
anchor.y + between_first_second_pokemon_offset.y,
],
"next_button_coordinates": [
anchor.x + next_button_offset.x,
anchor.y + next_button_offset.y,
],
"confirm_button_coordinates": [
anchor.x + confirm_button_offset.x,
anchor.y + confirm_button_offset.y,
],
"pokemon_details_left_health_white": [
anchor.x + pokemon_details_left_health_white_offset.x,
anchor.y + pokemon_details_left_health_white_offset.y,
],
"x_button_coordinates": [anchor.x + x_button_offset.x, anchor.y + x_button_offset.y],
"start_drag_next_poke": [
anchor.x + start_drag_next_poke_offset.x,
anchor.y + start_drag_next_poke_offset.y,
],
"end_drag_next_poke": [
anchor.x + end_drag_next_poke_offset.x,
anchor.y + end_drag_next_poke_offset.y,
],
"modify_favorite": [
anchor.x + modify_favorite_offset.x,
anchor.y + modify_favorite_offset.y,
],
"lets_do_it_coordinates": [
anchor.x + lets_do_it_offset.x,
anchor.y + lets_do_it_offset.y,
],
"great_league_coordinates": [
anchor.x + great_league_offset.x,
anchor.y + great_league_offset.y,
],
"ultra_league_coordinates": [
anchor.x + ultra_league_offset.x,
anchor.y + ultra_league_offset.y,
],
"master_league_coordinates": [
anchor.x + master_league_offset.x,
anchor.y + master_league_offset.y,
],
"lets_battle_coordinates": [
anchor.x + lets_battle_offset.x,
anchor.y + lets_battle_offset.y,
],
"first_pokemon_in_party_coordinates": [
anchor.x + first_pokemon_in_party_offset.x,
anchor.y + first_pokemon_in_party_offset.y,
],
"use_party_coordinates": [
anchor.x + use_party_offset.x,
anchor.y + use_party_offset.y,
],
"rematch_coordinates": [anchor.x + rematch_offset.x, anchor.y + rematch_offset.y],
"sort_button_coordinates": [
anchor.x + sort_button_offset.x,
anchor.y + sort_button_offset.y,
],
"first_pokemon_coordinates": [
anchor.x + first_pokemon_offset.x,
anchor.y + first_pokemon_offset.y,
],
"second_pokemon_coordinates": [
anchor.x + second_pokemon_offset.x,
anchor.y + second_pokemon_offset.y,
],
"third_pokemon_coordinates": [
anchor.x + third_pokemon_offset.x,
anchor.y + third_pokemon_offset.y,
],
"done_button_coordinates": [
anchor.x + done_button_offset.x,
anchor.y + done_button_offset.y,
],
"change_prng": True,
}
131 changes: 131 additions & 0 deletions configs/iPhoneMax.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
"""
This is a config file for screen mirroring with an iPhone 15 Pro Max.
To use this with an iPhone 15 Pro Max, the only thing you should modify is the `anchor` variable.
"""

from Point import Point

# Red 'x' in the top left of the mirroring window
anchor = Point(3115, 695) # 36" windscreen monitor
anchor = Point(1595, 335) # 1080p monitor

# Individual offset values
start_battle_offset = Point(262, 590)
start_trade_offset = Point(112, 568) # TODO: Update this since remote trades were added
first_trade_pokemon_offset = Point(46, 258)
between_first_second_pokemon_offset = Point(98, 252) # unused
next_button_offset = Point(153, 626)
confirm_button_offset = Point(26, 391)
pokemon_details_left_health_white_offset = Point(31, 326) # unused
x_button_offset = Point(153, 694)
start_drag_next_poke_offset = Point(281, 437)
end_drag_next_poke_offset = Point(32, 437)
modify_favorite_offset = Point(286, 75)
lets_do_it_offset = Point(150, 459)
great_league_offset = Point(157, 347)
ultra_league_offset = Point(157, 452)
master_league_offset = Point(157, 556)
lets_battle_offset = Point(150, 451)
first_pokemon_in_party_offset = Point(63, 547)
use_party_offset = Point(151, 664)
rematch_offset = Point(153, 479)
sort_button_offset = Point(273, 625) # unused
first_pokemon_offset = Point(45, 331)
second_pokemon_offset = Point(152, 331)
third_pokemon_offset = Point(258, 331)
done_button_offset = Point(228, 707)

# Recreated configuration using anchor + individual offsets
coordinates = {
"start_battle_coordinates": [
anchor.x + start_battle_offset.x,
anchor.y + start_battle_offset.y,
],
"start_trade_coordinates": [
anchor.x + start_trade_offset.x,
anchor.y + start_trade_offset.y,
],
"first_trade_pokemon_coordinates": [
anchor.x + first_trade_pokemon_offset.x,
anchor.y + first_trade_pokemon_offset.y,
],
"between_first_second_pokemon": [
anchor.x + between_first_second_pokemon_offset.x,
anchor.y + between_first_second_pokemon_offset.y,
],
"next_button_coordinates": [
anchor.x + next_button_offset.x,
anchor.y + next_button_offset.y,
],
"confirm_button_coordinates": [
anchor.x + confirm_button_offset.x,
anchor.y + confirm_button_offset.y,
],
"pokemon_details_left_health_white": [
anchor.x + pokemon_details_left_health_white_offset.x,
anchor.y + pokemon_details_left_health_white_offset.y,
],
"x_button_coordinates": [anchor.x + x_button_offset.x, anchor.y + x_button_offset.y],
"start_drag_next_poke": [
anchor.x + start_drag_next_poke_offset.x,
anchor.y + start_drag_next_poke_offset.y,
],
"end_drag_next_poke": [
anchor.x + end_drag_next_poke_offset.x,
anchor.y + end_drag_next_poke_offset.y,
],
"modify_favorite": [
anchor.x + modify_favorite_offset.x,
anchor.y + modify_favorite_offset.y,
],
"lets_do_it_coordinates": [
anchor.x + lets_do_it_offset.x,
anchor.y + lets_do_it_offset.y,
],
"great_league_coordinates": [
anchor.x + great_league_offset.x,
anchor.y + great_league_offset.y,
],
"ultra_league_coordinates": [
anchor.x + ultra_league_offset.x,
anchor.y + ultra_league_offset.y,
],
"master_league_coordinates": [
anchor.x + master_league_offset.x,
anchor.y + master_league_offset.y,
],
"lets_battle_coordinates": [
anchor.x + lets_battle_offset.x,
anchor.y + lets_battle_offset.y,
],
"first_pokemon_in_party_coordinates": [
anchor.x + first_pokemon_in_party_offset.x,
anchor.y + first_pokemon_in_party_offset.y,
],
"use_party_coordinates": [
anchor.x + use_party_offset.x,
anchor.y + use_party_offset.y,
],
"rematch_coordinates": [anchor.x + rematch_offset.x, anchor.y + rematch_offset.y],
"sort_button_coordinates": [
anchor.x + sort_button_offset.x,
anchor.y + sort_button_offset.y,
],
"first_pokemon_coordinates": [
anchor.x + first_pokemon_offset.x,
anchor.y + first_pokemon_offset.y,
],
"second_pokemon_coordinates": [
anchor.x + second_pokemon_offset.x,
anchor.y + second_pokemon_offset.y,
],
"third_pokemon_coordinates": [
anchor.x + third_pokemon_offset.x,
anchor.y + third_pokemon_offset.y,
],
"done_button_coordinates": [
anchor.x + done_button_offset.x,
anchor.y + done_button_offset.y,
],
"change_prng": False,
}
Loading