From 732836b0f80da57904497dc0556d135a3cfce56f Mon Sep 17 00:00:00 2001 From: Nes Date: Sat, 15 Jun 2024 16:37:25 -0700 Subject: [PATCH] Uploaded Dino and Surf scripts. --- dino.bat | 2 ++ dino.py | 20 ++++++++++++++++++++ setup.bat | 16 ++++++++++++++++ surf.bat | 2 ++ surf.py | 20 ++++++++++++++++++++ 5 files changed, 60 insertions(+) create mode 100644 dino.bat create mode 100644 dino.py create mode 100644 setup.bat create mode 100644 surf.bat create mode 100644 surf.py diff --git a/dino.bat b/dino.bat new file mode 100644 index 0000000..37e5f77 --- /dev/null +++ b/dino.bat @@ -0,0 +1,2 @@ +@echo off +python dino.py \ No newline at end of file diff --git a/dino.py b/dino.py new file mode 100644 index 0000000..3a87b94 --- /dev/null +++ b/dino.py @@ -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') \ No newline at end of file diff --git a/setup.bat b/setup.bat new file mode 100644 index 0000000..8c3664e --- /dev/null +++ b/setup.bat @@ -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 \ No newline at end of file diff --git a/surf.bat b/surf.bat new file mode 100644 index 0000000..a2138ee --- /dev/null +++ b/surf.bat @@ -0,0 +1,2 @@ +@echo off +python surf.py \ No newline at end of file diff --git a/surf.py b/surf.py new file mode 100644 index 0000000..c11844d --- /dev/null +++ b/surf.py @@ -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') \ No newline at end of file