-
Notifications
You must be signed in to change notification settings - Fork 0
/
p3_manastone.inc
executable file
·102 lines (80 loc) · 3.2 KB
/
p3_manastone.inc
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
SUB p3_manastone_init() {
/declare haveManastone bool outer FALSE
/declare manastoneCooldown timer outer 0
/declare checkForManastoneTimer timer outer 0
/if (${FindItemCount[Manastone]}>0) /varset haveManastone TRUE
/declare tapMethod string outer EQUALIZE
/declare tapSpamTime string outer 1s
/declare tapSpamTimeTimer timer outer 0
/declare tapLockoutTime string outer 5s
/declare manastoneLockoutTimer timer outer 0
/declare manastoneMinHP int outer 50
/declare manastoneMinHPNC int outer 50
/declare prioritizeHeals bool outer FALSE
/declare useSoftTap bool outer TRUE
/declare softTapCounter int outer TRUE
/declare softTapSpeed int outer 30
/declare tapUpToMana outer 80
/declare requireBuffPresent outer -
/varset tapMethod ${getBotIniOption[Manastone.TapMethod,${tapMethod}]}
/varset tapSpamTime ${getBotIniOption[Manastone.TapSpamTime,${tapSpamTime}]}
/varset tapLockoutTime ${getBotIniOption[Manastone.TapLockoutTime,${tapLockoutTime}]}
/varset manastoneMinHP ${getBotIniOption[Manastone.MinimumHP,${manastoneMinHP}]}
/varset manastoneMinHPNC ${getBotIniOption[Manastone.MinimumHPNonCombat,${manastoneMinHPNC}]}
/varset tapUpToMana ${getBotIniOption[Manastone.MaximumMana,${tapUpToMana}]}
/varset requireBuffPresent ${getBotIniOption[Manastone.RequireBuffPresent,${requireBuffPresent}]}
/varset prioritizeHeals ${getBotIniOption[Manastone.PrioritizeHeals,${prioritizeHeals}]}
/varset useSoftTap ${getBotIniOption[Manastone.SafeTap,${useSoftTap}]}
/varset softTapSpeed ${getBotIniOption[Manastone.SoftTapSpeed,${softTapSpeed}]}
/varset tapMethod ${tapMethod.Upper}
/RETURN
}
SUB manastoneMaintenance() {
/if (${healIdleTimer}>0 && ${prioritizeHeals}==TRUE) /return
/if (${manastoneLockoutTimer}>0) /return
/if (${Me.PctMana}>=${tapUpToMana}) /RETURN
/if (${Zone.ID}==202) /return
/if (${Me.Casting.ID}!=NULL) /return
/if (${Me.Invis}==TRUE) /return
/declare useMinHP int local ${manastoneMinHP}
/declare useTapTime int local ${tapSpamTime}
/if (${Select[${Me.CombatState},COOLDOWN, ACTIVE, RESTING]}!=0) /varset useMinHP ${manastoneMinHPNC}
/if (${Select[${Me.CombatState},COOLDOWN, ACTIVE, RESTING]}!=0) /varset useTapTime 100
/if (${checkForManastoneTimer}==0) {
/if (${FindItemCount[Manastone]}==0) {
/varset haveManastone FALSE
} else {
/varset haveManastone TRUE
}
/varset checkForManastoneTimer 1s
}
/if (${haveManastone}==FALSE) /return
/if (${requireBuffPresent.NotEqual[FALSE]} && (${Me.Buff[${requireBuffPresent}].ID}==NULL && ${Me.Song[${requireBuffPresent}].ID}==NULL)) {
/return
}
/varset tapSpamTimeTimer ${useTapTime}
/if (${tapMethod.Equal[EQUALIZE]}) {
/while (${Me.PctMana} < 90 && ${Me.PctHPs} > ${Me.PctMana} && ${tapSpamTimeTimer}>0) {
/useitem manastone
/call checkSoftTap
}
} else {
/while (${Me.PctHPs}>${useMinHP} && ${Me.PctMana} < ${tapUpToMana} && ${tapSpamTimeTimer}>0) {
/useitem manastone
/call checkSoftTap
}
}
/echo Finished this round of manastone tapping...
/varset manastoneLockoutTimer ${tapLockoutTime}
/delay 1
/RETURN
}
SUB checkSoftTap() {
/if (${useSoftTap}==FALSE) /return
/varset softTapCounter ${Math.Calc[${softTapCounter}+1]}
/if (${softTapCounter}==30) {
/varset softTapCounter 0
/delay 1
}
/RETURN
}