-
Notifications
You must be signed in to change notification settings - Fork 2
/
outdated_idle_exp.py
66 lines (48 loc) · 1.54 KB
/
outdated_idle_exp.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
from random import choices, uniform
from time import perf_counter, sleep
import click
from loguru import logger
from game_controller import GameController
from settings import (
RANDOM_TURN_PROB,
SPOT_DELAY,
USE_BOOSTERS_AFTER,
USE_PASSIVE_SKILLS_AFTER,
)
from utils import set_logger_level
@click.command()
@click.option("--debug", is_flag=True, help="Enable debug mode.")
def main(debug):
if debug:
set_logger_level("DEBUG")
set_logger_level("INFO")
run()
def run():
game = GameController(start_delay=5)
last_booster_act_time = perf_counter()
last_passive_skills_act_time = perf_counter()
game.toggle_passive_skills()
game.mount()
game.use_boosters()
game.start_attack()
while game.is_running:
game.lure_many()
if perf_counter() - last_booster_act_time >= USE_BOOSTERS_AFTER:
last_booster_act_time = perf_counter()
game.use_boosters()
if perf_counter() - last_passive_skills_act_time >= USE_PASSIVE_SKILLS_AFTER:
last_passive_skills_act_time = perf_counter()
game.stop_attack()
game.unmount()
game.toggle_passive_skills()
game.mount()
game.start_attack()
if choices([True, False], weights=[RANDOM_TURN_PROB, 1 - RANDOM_TURN_PROB]):
game.turn_randomly()
sleep(uniform(SPOT_DELAY - 1, SPOT_DELAY + 1))
game.pickup_many()
game.stop_attack()
game.unmount()
if __name__ == '__main__':
main()
logger.success("Bot terminated.")