Open Mustwey opened 1 year ago
I am indeed very intersted, got discord?
yes
the_overthinking_sigma
i say we use appium automation with adb and appium ui dumping(adb dumps bluestacks ui, im hoping appium dumps the actual androids ui with all the games and important stuff), this way its no longer image recognition and we actually click the ui elements directly, but idk how to
import time
import random
import keyboard
import pyautogui
import win32api
import win32con
import threading
COORDS = {
'play': (1504, 929, (115, 207, 28)),
'dont_save_1': (601, 802, (236, 69, 31)),
'dont_save_2': (646, 804, (234, 67, 29)),
'collect': (866, 936, (105, 200, 16)),
'yes': (742, 768, (235, 68, 30)),
'battle_chest': (763, 770, (255, 255, 255))
}
def click(x, y):
win32api.SetCursorPos((x, y))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)
time.sleep(random.uniform(0.1, 0.2))
win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)
def press_key(key, delay=0.5):
keyboard.press(key)
time.sleep(random.uniform(0.1, 0.4))
keyboard.release(key)
print(f'{key} key pressed')
time.sleep(delay)
def sleep_with_dots(seconds):
elapsed_time = 0.0
while elapsed_time < seconds:
print(".", end="", flush=True)
time.sleep(0.5)
elapsed_time += 0.5
print()
def check_pixel_match(coord_key):
x, y, rgb = COORDS[coord_key]
return pyautogui.pixel(x, y)[:3] == rgb
def battle_chest():
if check_pixel_match('battle_chest'):
print('"Battle Chest" button is available')
click(*COORDS['battle_chest'][:2])
print('Battle Chest opened')
sleep_with_dots(2)
press_key('esc')
play_verification()
def play_verification():
while not check_pixel_match('play'):
print('"Play" button is NOT available')
press_key('esc')
if check_pixel_match('yes'):
print('"Yes" button is available')
click(*COORDS['yes'][:2])
print('"Yes" button for confirming the ad closing was clicked')
print('"Play" button is available')
battle_chest()
click(*COORDS['play'][:2])
print('"Play" button clicked')
def verify_if_game_is_over():
sleep_with_dots(10)
while True:
sleep_with_dots(random.uniform(3, 5))
press_key('w', 0.4) # Simulate walking
if check_pixel_match('dont_save_1'):
print('"Dont Save 1" button has appeared')
press_key('esc')
break
elif check_pixel_match('dont_save_2'):
print('"Dont Save 2" button has appeared')
press_key('esc')
break
elif check_pixel_match('collect'):
print('"Collect" button has appeared')
press_key('esc')
break
def main():
sleep_with_dots(2)
while not keyboard.is_pressed('k'):
play_thread = threading.Thread(target=play_verification)
game_over_thread = threading.Thread(target=verify_if_game_is_over)
play_thread.start()
game_over_thread.start()
play_thread.join()
game_over_thread.join()
print("\nGame cycle complete.\n")
if __name__ == "__main__":
try:
main()
except Exception as e:
print(f"An error occurred: {e}")
i have written code for using adb, and stuff if you want, can we combine the code and make a full fledged bot for bullet echo?