Uploaded Dino and Surf scripts.

main
Nes 2024-06-15 16:37:25 -07:00
commit 732836b0f8
5 changed files with 60 additions and 0 deletions

2
dino.bat Normal file
View File

@ -0,0 +1,2 @@
@echo off
python dino.py

20
dino.py Normal file
View File

@ -0,0 +1,20 @@
import time
import pyautogui
import webbrowser
# Open Chrome
chrome_path = "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe"
webbrowser.register('chrome', None, webbrowser.BackgroundBrowser(chrome_path))
webbrowser.get('chrome').open("http://google.com") # This opens Chrome to a default page
# Give it a few seconds to load
time.sleep(1)
# Focus on the address bar
pyautogui.hotkey('ctrl', 'l')
# Type the URL for the Dinosaur game
pyautogui.typewrite('chrome://dino', interval=0.02)
# Press Enter
pyautogui.press('enter')

16
setup.bat Normal file
View File

@ -0,0 +1,16 @@
@echo off
::Check if python is installed
:check
python --version 3>NUL
if errorlevel 1 goto errorNoPython
::If python is installed then it runs the program
pip install pyautogui
exit
::Install python
:errorNoPython
python
timeout /t 60
goto check

2
surf.bat Normal file
View File

@ -0,0 +1,2 @@
@echo off
python surf.py

20
surf.py Normal file
View File

@ -0,0 +1,20 @@
import time
import pyautogui
import webbrowser
# Open Edge
edge_path = "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
webbrowser.register('edge', None, webbrowser.BackgroundBrowser(edge_path))
webbrowser.get('edge').open("http://bing.com") # This opens Edge to a default page
# Give it a few seconds to load
time.sleep(1)
# Focus on the address bar
pyautogui.hotkey('ctrl', 'l')
# Type the URL for the Surfing game
pyautogui.typewrite('edge://surf', interval=0.02)
# Press Enter
pyautogui.press('enter')