Spaces:
Sleeping
Sleeping
Yichuan Wang
commited on
Commit
·
54ffdad
1
Parent(s):
7bb971a
finish code but seems gui does not work
Browse files- .DS_Store +0 -0
- dev_geoguessr_bot.ipynb +0 -0
- geoguessr_bot.py +8 -2
- main_single_player.py +1 -0
- screen_regions.yaml +16 -16
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
dev_geoguessr_bot.ipynb
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
geoguessr_bot.py
CHANGED
|
@@ -163,11 +163,17 @@ class GeoBot:
|
|
| 163 |
|
| 164 |
def select_map_location(self, x: int, y: int, plot: bool = False) -> None:
|
| 165 |
# Hovering over the minimap to expand it
|
| 166 |
-
pyautogui.moveTo(self.map_x+self.map_w-15, self.map_y+self.map_h-15, duration=0.5)
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
|
| 169 |
# Clicking on the predicted location
|
| 170 |
pyautogui.click(x, y, duration=0.5)
|
|
|
|
|
|
|
| 171 |
|
| 172 |
if plot:
|
| 173 |
self.plot_minimap(x, y)
|
|
|
|
| 163 |
|
| 164 |
def select_map_location(self, x: int, y: int, plot: bool = False) -> None:
|
| 165 |
# Hovering over the minimap to expand it
|
| 166 |
+
# pyautogui.moveTo(self.map_x+self.map_w-15, self.map_y+self.map_h-15, duration=0.5)
|
| 167 |
+
#bot.screen_w-50, bot.screen_h-80
|
| 168 |
+
pyautogui.moveTo(self.screen_w-50, self.screen_h-80, duration=1.5)
|
| 169 |
+
print(self.screen_w-50, self.screen_h-80)
|
| 170 |
+
print('finish moving')
|
| 171 |
+
sleep(1.5)
|
| 172 |
|
| 173 |
# Clicking on the predicted location
|
| 174 |
pyautogui.click(x, y, duration=0.5)
|
| 175 |
+
print('finish clicking')
|
| 176 |
+
sleep(0.5)
|
| 177 |
|
| 178 |
if plot:
|
| 179 |
self.plot_minimap(x, y)
|
main_single_player.py
CHANGED
|
@@ -30,6 +30,7 @@ def play_turn(bot: GeoBot, plot: bool = False):
|
|
| 30 |
bot.select_map_location(*location, plot=plot)
|
| 31 |
else:
|
| 32 |
print("Error getting a location for second time")
|
|
|
|
| 33 |
bot.select_map_location(x=1, y=1, plot=plot)
|
| 34 |
|
| 35 |
# Going to the next round
|
|
|
|
| 30 |
bot.select_map_location(*location, plot=plot)
|
| 31 |
else:
|
| 32 |
print("Error getting a location for second time")
|
| 33 |
+
# TODO: strange default location, may neeed to change
|
| 34 |
bot.select_map_location(x=1, y=1, plot=plot)
|
| 35 |
|
| 36 |
# Going to the next round
|
screen_regions.yaml
CHANGED
|
@@ -1,24 +1,24 @@
|
|
| 1 |
confirm_button_1:
|
| 2 |
-
-
|
| 3 |
-
-
|
| 4 |
hobart_1:
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
kodiak_1:
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
map_bot_right_1:
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
map_top_left_1:
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
next_round_button:
|
| 17 |
-
-
|
| 18 |
-
-
|
| 19 |
screen_bot_right:
|
| 20 |
-
-
|
| 21 |
-
-
|
| 22 |
screen_top_left:
|
| 23 |
-
-
|
| 24 |
-
-
|
|
|
|
| 1 |
confirm_button_1:
|
| 2 |
+
- 1606
|
| 3 |
+
- 1049
|
| 4 |
hobart_1:
|
| 5 |
+
- 1784
|
| 6 |
+
- 882
|
| 7 |
kodiak_1:
|
| 8 |
+
- 1358
|
| 9 |
+
- 716
|
| 10 |
map_bot_right_1:
|
| 11 |
+
- 1885
|
| 12 |
+
- 1013
|
| 13 |
map_top_left_1:
|
| 14 |
+
- 1290
|
| 15 |
+
- 586
|
| 16 |
next_round_button:
|
| 17 |
+
- 1276
|
| 18 |
+
- 994
|
| 19 |
screen_bot_right:
|
| 20 |
+
- 1914
|
| 21 |
+
- 1069
|
| 22 |
screen_top_left:
|
| 23 |
+
- 589
|
| 24 |
+
- 147
|