added multi run and energy limits to equip

This commit is contained in:
2022-05-21 23:49:37 +02:00
parent 36c0b2fcb0
commit ccea230bf1

View File

@@ -17,13 +17,15 @@ EMITTER_SWORD = "sword"
EMITTER_STAFF = "staff"
EMITTER_WAND = "wand"
EMITTER_RING = "ring"
EMITTER_ALL = "all"
HSV_DEFAULT = HsvFilter(0, 0, 0, 179, 255, 255, 0, 0, 0, 0)
def run():
EMITTER_TO_USE = EMITTER_WAND
EMITTER_TO_USE = EMITTER_ALL
SPAWN_COUNT = 15
ENERGY_TO_USE = 3000
# initialize the user-class
config = UserConfigs()
@@ -46,17 +48,30 @@ def run():
hsvs = []
tresholds = []
masks = []
emitters = []
if EMITTER_TO_USE == EMITTER_MUSH:
if EMITTER_TO_USE == EMITTER_ALL:
emitters.append(EMITTER_RING)
emitters.append(EMITTER_WAND)
emitters.append(EMITTER_SWORD)
emitters.append(EMITTER_STAFF)
emitters.append(EMITTER_AMU)
else:
emitters.append(EMITTER_TO_USE)
energy_counter = 0
pause = True
for emitter in emitters:
if emitter == EMITTER_MUSH:
include_books(needles, hsvs, tresholds, masks)
include_mushs(needles, hsvs, tresholds, masks)
include_pots(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_AMU:
elif emitter == EMITTER_AMU:
include_books(needles, hsvs, tresholds, masks)
include_amus(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_MAIN:
elif emitter == EMITTER_MAIN:
include_books(needles, hsvs, tresholds, masks)
include_chests(needles, hsvs, tresholds, masks)
include_keys(needles, hsvs, tresholds, masks)
@@ -64,24 +79,24 @@ def run():
include_bags(needles, hsvs, tresholds, masks)
include_coins(needles, hsvs, tresholds, masks)
include_runes(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_SWORD:
elif emitter == EMITTER_SWORD:
include_books(needles, hsvs, tresholds, masks)
include_swords(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_STAFF:
elif emitter == EMITTER_STAFF:
include_books(needles, hsvs, tresholds, masks)
include_staffs(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_RING:
elif emitter == EMITTER_RING:
include_books(needles, hsvs, tresholds, masks)
include_rings(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
elif EMITTER_TO_USE == EMITTER_WAND:
elif emitter == EMITTER_WAND:
include_books(needles, hsvs, tresholds, masks)
include_wands(needles, hsvs, tresholds, masks)
include_bags(needles, hsvs, tresholds, masks)
pause = True
while True:
if keyboard.is_pressed('p') == True:
pause = True
@@ -105,19 +120,22 @@ def run():
# cv.imshow("screenshot", screenshot)
# cv.waitKey(150)
# continue
if energy_counter >= ENERGY_TO_USE:
energy_counter = 0
break
spawn_0_location = []
spawn_1 = find_emitter(EMITTER_TO_USE, vision_stun, screenshot, 1)
spawn_1 = find_emitter(emitter, vision_stun, screenshot, 1)
if len(spawn_1) == 1:
spawn_button_active = True
points = vision_stun.get_click_points(spawn_1)
for i in range(0, SPAWN_COUNT, 1):
click_point(config, points[0][0], points[0][1])
energy_counter = energy_counter + 1
if keyboard.is_pressed('p') == True or pause == True:
pause = True
break
else:
spawn_0 = find_emitter(EMITTER_TO_USE, vision_stun, screenshot, 0)
spawn_0 = find_emitter(emitter, vision_stun, screenshot, 0)
points = vision_stun.get_click_points(spawn_0)
for point in points:
click_point(config, points[0][0], points[0][1])