-
Notifications
You must be signed in to change notification settings - Fork 1
/
hortensia_magonia.lua
137 lines (119 loc) · 4.61 KB
/
hortensia_magonia.lua
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
require("utils/lib_loader")
LOG_ENABLED = false
ALLOWED_AP_OPTIONS = {
"AP10",
"AP30",
"AP50",
"APMAX"
}
ALLOWED_BP_OPTIONS = {
"EVENT_BP50",
"EVENT_BPMAX"
}
FINAL_WAVE_SKILL = true
MUS_PAUSE = 0.1
MUS_HOLD = 0.1
MUSA_PAUSE = 5
MUSA_HOLD = 0.3
if LOG_ENABLED then
log("\n\n\nbegin script logging:")
end
-------------------------------
-- Options for Battle Select --
-------------------------------
local mission_sel = function()
return retry(magonia_home_tap_mission("THIRD"))(10)
end
-------------------------------
-- Options for Unit Select --
-------------------------------
local unit_sel_attack = function()
act_once(magonia_boss_unit_select_tap_unit(1))(MUS_PAUSE, MUS_HOLD)
act_once(magonia_boss_unit_select_tap_attack)(MUSA_PAUSE, MUSA_HOLD)
return magonia_execute_boss_battle()
end
local function unit_sel_attack1()
act_once(magonia_boss_unit_select_tap_unit(2))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack1, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(3))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack1, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(4))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack1, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_attack)(MUSA_PAUSE, MUSA_HOLD)
return magonia_execute_boss_battle()
end)
end)
end)
end
local function unit_sel_attack2()
act_once(magonia_boss_unit_select_tap_unit(3))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack2, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(4))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack2, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(5))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack2, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_attack)(MUSA_PAUSE, MUSA_HOLD)
return magonia_execute_boss_battle()
end)
end)
end)
end
local function unit_sel_attack3()
act_once(magonia_boss_unit_select_tap_unit(3))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack3, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(4))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack3, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_unit(6))(MUS_PAUSE, MUS_HOLD)
return magonia_boss_unit_select_with_insufficient_bp_check(ALLOWED_BP_OPTIONS, unit_sel_attack3, magonia_execute_boss_battle)(function()
act_once(magonia_boss_unit_select_tap_attack)(MUSA_PAUSE, MUSA_HOLD)
return magonia_execute_boss_battle()
end)
end)
end)
end
--local exec_battle = unit_sel_attack
local exec_battle = function()
unit_sel_attack1()
if magonia_boss_unit_select() then
unit_sel_attack2()
if magonia_boss_unit_select() then
unit_sel_attack3()
end
end
end
local request_aid = function()
retry(magonia_boss_unit_select_tap_aid_request)(1)
retry(magonia_boss_unit_select_aid_request_tap_all)()
end
function execute_with(mission_sel)
return function(k)
retry(magonia_home_tap_pots)()
if not is_pot_available() then
retry(missions_tap_home_or_back)()
return with_insufficient_ap_check(mission_sel, ALLOWED_AP_OPTIONS)(function()
-- Regular Mission
retry(battle_helper_select_tap_first_helper)(2)
retry(battle_party_select_tap_confirm)()
return in_battle_daemon()(function()
mission_complete_proceed_to_rewards_confirm()
mission_complete_rewards_confirm(10)
return k()
end)
end)
end
retry(magonia_pots_first_tap_break)()
retry(magonia_pots_first_break_tap_normal)()
while not magonia_boss_unit_select() do
retry(magonia_boss_appeared_tap_skip)()
end
return magonia_conduct_boss_battle(exec_battle, request_aid)(function()
magonia_boss_battle_complete_confirm_rewards()
return k()
end)
end
end
local execute = execute_with(mission_sel)
local function main()
return execute(main)
end
main()