-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdinobot.py
33 lines (27 loc) · 961 Bytes
/
dinobot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import argparse
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
parser = argparse.ArgumentParser()
# Flag to start program on bot mode
parser.add_argument("-b", "--bot", action='store_true',
help="play using a bot")
# Flag to start program on video capture mode
parser.add_argument("-v", "--video", action='store_true',
help="play using video capture")
args = parser.parse_args()
# If both flags are set, raise error
if args.bot == args.video == True:
print("Both flags -b and -v are set. Please use only one.")
exit()
# Open Chrome browser on the game URL
s = Service('./chromedriver')
driver = webdriver.Chrome(service=s)
driver.set_window_position(800, 500)
driver.set_window_size(1024, 768)
driver.get("https://offline-dino-game.firebaseapp.com/")
if args.video:
# Open video capture mode
import videomode
if args.bot:
# Open bot mode
import botmode