Просмотр исходного кода

Small fix.

Fixed the broken md link (##blacklist !== #blacklist, :ok_hand:)
Added additional info about the dublicate warning (Users thought its error).
Fixed the CAPs `arg` not being recognized.
Now lists less dublicates if same item exists in more than 2 pages.
Risenio лет назад: 6
Родитель
Сommit
4f3a1252b4
3 измененных файлов с 11 добавлено и 9 удалено
  1. 4 2
      README.md
  2. 5 5
      index.js
  3. 2 2
      manifest.json

+ 4 - 2
README.md

@@ -23,11 +23,11 @@
           - Open bank, then try add that item to bank to (un)blacklist it.
             * Note: Item will not be banked while this enabled.
     * `ab bl <reset/default>`:
-      - This command resets the blacklist to the [default blacklist](##Blacklist).
+      - This command resets the blacklist to the [default blacklist](#Blacklist).
     * `ab bl <clear/empty>`:
       - This will empty up the entire blacklist, to have 0 blacklisted items.
     * `ab bl list`:
-      - Lists all the items that are currently blacklisted.
+      - Lists all the items that are currently blacklisted. (The items in blue are clickable links, you can click it to show the item.)
   ---
   - `autobank <guild/g>` toggles banking to guild bank. **Default Off**. 
 
@@ -85,6 +85,8 @@
       - If you're using Caali's proxy(toolbox), you don't have to do anything, as this comes along-with by default.
       - If you're using Pinkie's proxy, you will have to get it, via [this LINK](https://github.com/tera-mods-forks/tera-game-state) & place it in your mods folder (`[proxy dir]/mods`).
 
+## Additional information
+  It will also send a warning if the same exact item is available in more than one page (i.e. Dublicate) in your storage space. (the warning will include a blue clickable links, you can click it to show the item).
 
 ## Proof of concept
   <details>

+ 5 - 5
index.js

@@ -12,7 +12,6 @@ ReadFile()
 if (fs.existsSync(fn)) fs.watch(fn, event => { if (event === 'change') ReadFile() })
 
 module.exports = function AutoBank(mod) {
-
 	const NotCP = typeof mod.compileProto !== 'undefined'
 	const defs = { cPutWareItem: 3, sViewWareEx: 2 }
 
@@ -55,9 +54,10 @@ module.exports = function AutoBank(mod) {
 							dub2Slot = bankItemDub.slot - bankItemDub.offset + 1
 
 						if (dubItem.offset !== event.offset) QueuedMsgs.push(`${convToCLA(dubItem.id)} | First (${dubItem.offset / 72 + 1}:${getLine(dub1Slot)}:${dub1Slot !== 8 ? dub1Slot % 8 : 8}) ^ Second (${bankItemDub.offset / 72 + 1}:${getLine(dub2Slot)}:${dub2Slot !== 8 ? dub2Slot % 8 : 8})`)
+					} else {
+						AllCurrentBankItems.push(bankItemDub)
+						AllCurrentBankItemsIds.push(bankItemDub.id)
 					}
-					AllCurrentBankItems.push(bankItemDub)
-					AllCurrentBankItemsIds.push(bankItemDub.id)
 				}
 				const found = mod.game.inventory.findAllInBagOrPockets(bankItem.id)
 				if (found && found.length)
@@ -125,9 +125,8 @@ module.exports = function AutoBank(mod) {
 	function convToCLA(id) {
 		return `<font color="#7289DA"><ChatLinkAction param="1#####${id}">&lt;ID=${id}&gt;</ChatLinkAction></font>`
 	}
-	function validIdOrCLA(str) {
+	function validIdOrCLA(str, res = []) {
 		const [...match] = str.matchAll(/<ChatLinkAction.+?1#####([0-9]+).*?<\/ChatLinkAction>|(^[0-9]+|\s[0-9]+|[0-9]+\s)/gm)
-		let res = []
 		for (const m of match) res.push(Number.parseInt(m[1] || m[2]))
 		return res
 	}
@@ -189,6 +188,7 @@ module.exports = function AutoBank(mod) {
 
 	mod.command.add(['autobank', 'ab'], (key, arg, ...args) => {
 		if (key) key = key.toLowerCase()
+		if (arg) arg = arg.toLowerCase()
 		switch (key) {
 			case 'guild': case 'g':
 				GuildBanking = !GuildBanking

+ 2 - 2
manifest.json

@@ -1,7 +1,7 @@
 {
     "files": {
-        "README.md": "5bdf8fc3425cdde27a21c26506b9d405027b8d7410d0a6c85c31ad81cc1f9b9d",
-        "index.js": "db6504d31741530407e1c81760c41e3da58edd89a0ccbb8cf02213717ed95d94",
+        "README.md": "99b801199a44f9c52f6fb019f94833bdac9d3fb3b2f4a324668eecc52cb817b3",
+        "index.js": "4632d1b48745ac855d49e477b3b09f53ba9b668de631af841fde42cb442e5564",
         "module.json": "df54235a322877d003fa9a33d00cc19aaa8fb0808782399179e34d4e191fba8a",
         "package.json": "b9e2b74cb3dfef6d72d3829b2df3ca9d516c84e40daf22c8d141151c33769396"
     },