|
@@ -2,7 +2,7 @@ const path = require('path'); const fs = require('fs');
|
|
|
module.exports = function AutoPOT(mod) {
|
|
module.exports = function AutoPOT(mod) {
|
|
|
const cmd = mod.command || mod.require.command;
|
|
const cmd = mod.command || mod.require.command;
|
|
|
let config = getConfig(), hpPot = getHP(), mpPot = getMP();
|
|
let config = getConfig(), hpPot = getHP(), mpPot = getMP();
|
|
|
- let gPot = null, isReady = false, isSlaying = false, isZergling = false, nowHP = 0, nowMP = 0;
|
|
|
|
|
|
|
+ let gPot = null, isReady = false, isSlaying = false, nowHP = 0, nowMP = 0;
|
|
|
mod.game.initialize(['me', 'contract']);
|
|
mod.game.initialize(['me', 'contract']);
|
|
|
|
|
|
|
|
cmd.add(['autopot', 'pot'], (arg1, arg2) => {
|
|
cmd.add(['autopot', 'pot'], (arg1, arg2) => {
|
|
@@ -16,6 +16,14 @@ module.exports = function AutoPOT(mod) {
|
|
|
getId = getId ? Number(getId[1]) : 0;
|
|
getId = getId ? Number(getId[1]) : 0;
|
|
|
msg(`itemId: ${getId}.`);
|
|
msg(`itemId: ${getId}.`);
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case 'load':
|
|
|
|
|
+ case 'reload':
|
|
|
|
|
+ switch(arg2) {
|
|
|
|
|
+ case 'hp': hpPot = getHP(); msg(`HP.json has been reloaded.`); break;
|
|
|
|
|
+ case 'mp': mpPot = getMP(); msg(`MP.json has been reloaded.`); break;
|
|
|
|
|
+ case 'config': config = getConfig(); msg(`Config.json has been reloaded.`); break;
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
case 'notice':
|
|
case 'notice':
|
|
|
config.notice = !config.notice;
|
|
config.notice = !config.notice;
|
|
|
msg(`Notice has ${config.notice ? 'Enable' : 'Disable'}.`);
|
|
msg(`Notice has ${config.notice ? 'Enable' : 'Disable'}.`);
|
|
@@ -78,10 +86,6 @@ module.exports = function AutoPOT(mod) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- function msg(msg) {
|
|
|
|
|
- cmd.message(msg);
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
function useItem(itemId) {
|
|
function useItem(itemId) {
|
|
|
mod.send('C_USE_ITEM', 3, {
|
|
mod.send('C_USE_ITEM', 3, {
|
|
@@ -147,5 +151,7 @@ module.exports = function AutoPOT(mod) {
|
|
|
return s2a;
|
|
return s2a;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function msg(msg) {cmd.message(msg);}
|
|
|
|
|
+
|
|
|
function jsonSave(name,data) {fs.writeFile(path.join(__dirname, name), JSON.stringify(data, null, 4), err => {});}
|
|
function jsonSave(name,data) {fs.writeFile(path.join(__dirname, name), JSON.stringify(data, null, 4), err => {});}
|
|
|
}
|
|
}
|