|
@@ -64,14 +64,14 @@ module.exports = function AutoPOT(mod) {
|
|
|
hpPot[hp][1].inCd = true;
|
|
hpPot[hp][1].inCd = true;
|
|
|
setTimeout(function (h) {
|
|
setTimeout(function (h) {
|
|
|
hpPot[h][1].inCd = false;
|
|
hpPot[h][1].inCd = false;
|
|
|
- }, e.cooldown, hp);
|
|
|
|
|
|
|
+ }, e.cooldown * 1000, hp);
|
|
|
}
|
|
}
|
|
|
mp = mpPot.findIndex(item => s2n(item[0]) === e.item);
|
|
mp = mpPot.findIndex(item => s2n(item[0]) === e.item);
|
|
|
if (mp >= 0 && !mpPot[mp][1].inCd) {
|
|
if (mp >= 0 && !mpPot[mp][1].inCd) {
|
|
|
mpPot[mp][1].inCd = true;
|
|
mpPot[mp][1].inCd = true;
|
|
|
setTimeout(function (m) {
|
|
setTimeout(function (m) {
|
|
|
mpPot[m][1].inCd = false;
|
|
mpPot[m][1].inCd = false;
|
|
|
- }, e.cooldown, mp);
|
|
|
|
|
|
|
+ }, e.cooldown * 1000, mp);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -84,6 +84,7 @@ module.exports = function AutoPOT(mod) {
|
|
|
for (let hp = 0; hp < hpPot.length; hp++) {
|
|
for (let hp = 0; hp < hpPot.length; hp++) {
|
|
|
if (!hpPot[hp][1].inCd && ((!isSlaying && nowHP <= hpPot[hp][1].use_at && (hpPot[hp][1].inCombat ? mod.game.me.inCombat : true)) || (isSlaying && nowHP <= hpPot[hp][1].slay_at && mod.game.me.inCombat)) && hpPot[hp][1].amount > 0) {
|
|
if (!hpPot[hp][1].inCd && ((!isSlaying && nowHP <= hpPot[hp][1].use_at && (hpPot[hp][1].inCombat ? mod.game.me.inCombat : true)) || (isSlaying && nowHP <= hpPot[hp][1].slay_at && mod.game.me.inCombat)) && hpPot[hp][1].amount > 0) {
|
|
|
useItem(hpPot[hp]);
|
|
useItem(hpPot[hp]);
|
|
|
|
|
+ hpPot[hp][1].inCd = true;
|
|
|
hpPot[hp][1].amount--;
|
|
hpPot[hp][1].amount--;
|
|
|
if (config.notice)
|
|
if (config.notice)
|
|
|
msg(`Used ${hpPot[hp][1].name}, ${(hpPot[hp][1].amount)} left.`);
|
|
msg(`Used ${hpPot[hp][1].name}, ${(hpPot[hp][1].amount)} left.`);
|
|
@@ -95,6 +96,7 @@ module.exports = function AutoPOT(mod) {
|
|
|
for (let mp = 0; mp < mpPot.length; mp++) {
|
|
for (let mp = 0; mp < mpPot.length; mp++) {
|
|
|
if (!mpPot[mp][1].inCd && nowMP <= mpPot[mp][1].use_at && mpPot[mp][1].amount > 0 && (mpPot[mp][1].inCombat ? mod.game.me.inCombat : true)) {
|
|
if (!mpPot[mp][1].inCd && nowMP <= mpPot[mp][1].use_at && mpPot[mp][1].amount > 0 && (mpPot[mp][1].inCombat ? mod.game.me.inCombat : true)) {
|
|
|
useItem(mpPot[mp]);
|
|
useItem(mpPot[mp]);
|
|
|
|
|
+ mpPot[mp][1].inCd = true;
|
|
|
mpPot[mp][1].amount--;
|
|
mpPot[mp][1].amount--;
|
|
|
if (config.notice)
|
|
if (config.notice)
|
|
|
msg(`Used ${mpPot[mp][1].name}, ${(mpPot[mp][1].amount)} left.`);
|
|
msg(`Used ${mpPot[mp][1].name}, ${(mpPot[mp][1].amount)} left.`);
|