Added some basic adb scripts.

This commit is contained in:
Filip Strajnar 2024-09-05 21:48:48 +02:00
parent a9dd1c022a
commit cb7d49df27
3 changed files with 48 additions and 0 deletions

28
adb/dharok_nmz.py Normal file
View file

@ -0,0 +1,28 @@
import adb_bindings
import adb_bindings.adb
from adb_bindings.grid import Grid
from datetime import datetime, timedelta
from adb_bindings.randomize import random_sleep_between_second, random_sleep_between_millisecond, random_between
adb: adb_bindings.adb.Adb = adb_bindings.list_devices()[0]
inventory = Grid(1916, 462, 2254, 975, 7, 4)
def press_rock_cake():
adb.tap_center_of_grid_cell(inventory, 7, 1)
start = datetime.now()
while datetime.now() < (start + timedelta(hours=4)):
press_rock_cake()
random_sleep_between_millisecond(1000, 1300)
press_rock_cake()
random_sleep_between_millisecond(1000, 1300)
press_rock_cake()
row = random_between(1, 6)
column = random_between(1, 4)
print(f"{row} {column}")
random_sleep_between_millisecond(1000, 1300)
adb.tap_center_of_grid_cell(inventory, row, column)
random_sleep_between_second(110, 130)

1
adb/screenshot.sh Normal file
View file

@ -0,0 +1 @@
adb shell screencap -p /storage/emulated/0/Pictures/x.png ; adb pull /storage/emulated/0/Pictures/x.png

19
adb/spider.py Normal file
View file

@ -0,0 +1,19 @@
import adb_bindings
import adb_bindings.adb
from adb_bindings.grid import Grid
from datetime import datetime, timedelta
from adb_bindings.randomize import random_sleep_between_second, random_sleep_between_millisecond, random_between
adb: adb_bindings.adb.Adb = adb_bindings.list_devices()[0]
inventory = Grid(1916, 462, 2254, 975, 7, 4)
for col in range(1,5):
for row in range(1,8):
if row == 1 and col == 1:
continue
adb.tap_center_of_grid_cell(inventory, 1 , 1)
random_sleep_between_millisecond(100,200)
print(f"{row} {col}")
adb.tap_center_of_grid_cell(inventory, row, col)
random_sleep_between_millisecond(100,200)