-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpokemmo.auto_fight_from_pokecenter.py
executable file
·92 lines (77 loc) · 2.45 KB
/
pokemmo.auto_fight_from_pokecenter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/bin/env python
from autoclick import helpers
from autoclick import pokemmo
import time
options = [
"HOENN - Lilycove City grass hunt - lv. 22 - 26",
"HOENN - Peltaburg City fishing",
"HOENN - Fallarbor Town Grass lv. 15 - 18",
]
selected_option = helpers.create_select_interface(options)
def is_in_pokecenter(ss):
in_pokecenter = helpers.locateCenterOnImage(
"./imgs/pokemmo/pokecenter_joy.png", ss, confidence=0.9
)
return in_pokecenter
def keluar_pc(option):
# keluar dari pokecenter
for x in range(3):
time.sleep(1)
helpers.tap(500, 330)
helpers.tapHold(*pokemmo.grass_keys["down"], 2)
time.sleep(5)
if option == 0:
# keluar dari pokecenter peket bawah 6 kali dan kiri baru ke bawah
helpers.tapHold(*pokemmo.grass_keys["left"], 3.1)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["down"], 3)
elif option == 1:
helpers.tapHold(*pokemmo.grass_keys["down"], 3)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["left"], 5)
elif option == 2:
helpers.tapHold(*pokemmo.grass_keys["down"], 0.3)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["left"], 8.5)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["down"], 8)
def in_grass(option):
if option in [0]:
helpers.tapHold(*pokemmo.grass_keys["down"], 3)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["up"], 3)
elif option in [2]:
helpers.tapHold(*pokemmo.grass_keys["left"], 2)
time.sleep(1)
helpers.tapHold(*pokemmo.grass_keys["right"], 2)
elif option in [1]:
pokemmo.fishing()
# start
pokemmo.start()
inFight = False
while True:
ss = helpers.screenshot()
# break
if pokemmo.is_in_fight(ss):
print("in fight")
if inFight is False:
inFight = True
helpers.send_notify("POKEMMO: new fight")
pokemmo.fight()
elif is_in_pokecenter(ss):
print("pokecenter")
inFight = False
helpers.send_notify("POKEMMO: in pokecenter")
keluar_pc(selected_option)
elif pokemmo.is_in_grass(ss):
print("rumput")
inFight = False
in_grass(selected_option)
elif pokemmo.is_pilih_jurus_baru(ss):
print("select new move")
pokemmo.pilih_jurus_baru(ss)
elif pokemmo.is_select_pokemon(ss):
print("select pokemon")
pokemmo.select_pokemon()
#
time.sleep(2)