Fukki 8 years ago
parent
commit
a696e99994
2 changed files with 3 additions and 6 deletions
  1. 2 5
      index.js
  2. 1 1
      manifest.json

+ 2 - 5
index.js

@@ -2,8 +2,7 @@ const path = require('path'); const fs = require('fs');
 module.exports = function AutoPOT(mod) {
 	const cmd = mod.command || mod.require.command;
 	let config = getConfig(), hpPot = getHP(), mpPot = getMP();
-	let gameId = null, VehicleEx = null, getInv = false, useCombat = false;
-	let isSlaying = false, nowHP = 0, nowMP = 0;
+	let getInv = false, useCombat = false, isSlaying = false, nowHP = 0, nowMP = 0;
 
 	cmd.add(['autopot', 'pot'], (arg1, arg2) => {
 		if(arg1 && arg1.length > 0) arg1 = arg1.toLowerCase();
@@ -89,7 +88,7 @@ module.exports = function AutoPOT(mod) {
 
 	function useItem(itemId) {
 		mod.send('C_USE_ITEM', 3, {
-			gameId: gameId,
+			gameId: mod.game.me.gameId,
 			id: Number(itemId[0]),
 			amount: 1,
 			unk4: true
@@ -153,7 +152,5 @@ module.exports = function AutoPOT(mod) {
 	
 	function msg(msg) {cmd.message(msg);}
 	
-	function isMe(id) {return gameId.equals(id) || VehicleEx && VehicleEx.equals(id);}
-	
 	function jsonSave(name,data) {fs.writeFile(path.join(__dirname, name), JSON.stringify(data, null, 4), err => {});}
 }

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
 	"files": {
-		"index.js": "407f5cffe8a63b2f346d704e85f243928b899dbfb51bfc73b5100df8b61b66f5"
+		"index.js": "e5bb2911416a233b8bfef0bb8b5acabb99a8b2545f94ff097cb137f848f75889"
 	},
 	"defs": {
 		"C_USE_ITEM": 3,