Skip to content

Instantly share code, notes, and snippets.

@UnholyGnomes
Created June 27, 2022 21:29
Show Gist options
  • Save UnholyGnomes/69e8cf1636652af4a8f48c3323ae8031 to your computer and use it in GitHub Desktop.
Save UnholyGnomes/69e8cf1636652af4a8f48c3323ae8031 to your computer and use it in GitHub Desktop.
CV RS3 Dungeoneering Hole bot, to be improved.
import pyautogui
from time import sleep
import threading as th
Keep_Going = True
a_list = []
total = 0
def key_capture_thread(a_list):
global Keep_Going
input()
Keep_Going = False
def do_this(key_capture_thread, i=[0]):
th.Thread(target=key_capture_thread, args=(a_list),
name='key_capture_thread', daemon=True).start()
while Keep_Going:
i[0] += 1
sleep(2)
print('Still going...')
print('This is the', i, 'run.')
CheckCompass()
def CheckCompass():
print("Checking orientation...")
CorrectCompass = pyautogui.locateOnScreen(
r'\Users\Zach\Documents\Scripts\Python\Projects in Progress\RSBots\BeachBots\CorrectCompas.png', confidence=.90)
if CorrectCompass:
print("Correct orientation!")
MoveToHole()
else:
print("Correcting orientation...")
CompassLocation = 3037, 112
ResetCamera = pyautogui.locateOnScreen(
r'\Users\Zach\Documents\Scripts\Python\Projects in Progress\RSBots\BeachBots\ResetCamera.png', confidence=.90)
"Reset Camera Button not located... searching again."
sleep(1)
if ResetCamera:
pyautogui.click(CompassLocation)
pyautogui.keyDown('up')
pyautogui.keyDown('pageup')
sleep(2)
pyautogui.keyUp('up')
pyautogui.keyUp('pageup')
CheckCompass()
sleep(2)
else:
pyautogui._mouseMoveDrag(
x=3037, y=112, xOffset=3, yOffset=3, duration=2, moveOrDrag='drag')
def MoveToHole():
HoleLocation = 1900, 1462
HoleLocationConfirmed = pyautogui.locateOnScreen(
r'\Users\Zach\Documents\Scripts\Python\Projects in Progress\RSBots\BeachBots\HoleHoverConfirmation.png', confidence=.90)
DungeoneeringXPConfirm = pyautogui.locateOnScreen(
r'\Users\Zach\Documents\Scripts\Python\Projects in Progress\RSBots\BeachBots\DungeoneeringXPConfirm.png', confidence=.90)
print("Confirming that we are not gaining XP...")
if not DungeoneeringXPConfirm:
print("Not gaining XP... \nMoving mouse to supposed hole location...")
pyautogui.moveTo(HoleLocation)
if HoleLocationConfirmed and not DungeoneeringXPConfirm:
print("Hole found, and not gaining xp... clicking.")
pyautogui.click(HoleLocation)
sleep(2)
print("Gaining XP...")
sleep(2)
print("")
do_this(key_capture_thread)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment