-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainRunner.py
59 lines (41 loc) · 1.46 KB
/
MainRunner.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
import time
from ActionRecorder import ActionRecorder
from AutomationRunner import AutomationRunner
from KeyActions import KeyActions
from KeyID import KeyID
from Logger import Logger
maple_logger = Logger()
maple_logger.info("MapleBot started, welcome!")
maple_logger.info("Please ensure this program is being 'Run as administrator...'"
" so that it can interact with the On Screen Keyboard.")
time.sleep(1)
# user_input = input("Which action should be taken? 1: Record Action, 2: Run Action, 3: Debug Record Action, 4: Debug Run Action\n")
user_input = "2"
maple_logger.info("Running action {0}", user_input)
# 1. Record action
if user_input == "1":
automation_tag = input("Choose an automation tag \n")
action_recorder = ActionRecorder(automation_tag)
action_recorder.record_action_sequence()
# 2. Run Action
elif user_input == "2":
time.sleep(3)
automation_runner = AutomationRunner()
# run automation once
automation_runner.run_automation(123, True)
# 3. Debug Record Action
elif user_input == "3":
pass
# 4. Debug Run Action
else:
maple_logger.info(". . . . . . 2 seconds")
time.sleep(2)
key_actions = KeyActions()
key_actions.pressAndHold(KeyID.C, 1)
key_actions.pressAndHold(KeyID.O, 1)
key_actions.pressAndHold(KeyID.DOWN, 0.2)
key_actions.pressAndHold(KeyID.D, 1)
key_actions.tap(KeyID.Y)
key_actions.sayHello()
key_actions.saySomethingRandom()
maple_logger.info("Terminated.")