Browse Source

Small fix.

- Added warning stack, to avoid getting same warning more than once (if same exact quantity).
- Fix for readme `<br>`.
Mie 6 years ago
parent
commit
e0d45eca54
3 changed files with 11 additions and 9 deletions
  1. 6 6
      README.md
  2. 3 1
      index.js
  3. 2 2
      manifest.json

+ 6 - 6
README.md

@@ -88,12 +88,12 @@
 ## Additional information
   It will also send a warning if the same exact item is available in more than one page (i.e. Duplicate) in your storage space. (the warning will include a blue clickable links, you can click it to show the item).
 
-  * FAQ
-    ? It have banked an item for me, and now I can't withdraw it with "That item isn't in your bank" error.
-    A: This is unrelated to script, simply you have same item, but 2 different time remaining, so make sure you don't withdraw with quantity or by right clicking on wrong stacks.
-    ? It have banked all the way until full page and continued in next page.
-    ? It have banked same item in 2 different pages.
-    A: Its impossible, script will never bank an item in different page, even if page is full. (Make sure you don't already have that item in different pages, aka see duplicate log).
+  * FAQ<br>
+    - ? It have banked an item for me, and now I can't withdraw it with "That item isn't in your bank" error.
+      - A: This is unrelated to script, simply you have same item, but 2 different time remaining, so make sure you don't withdraw with quantity or by right clicking on wrong stack of that item.
+    - ? It have banked all the way until full page and continued in next page.
+    - ? It have banked same item in 2 different pages.
+      - A: Its impossible, script will never bank an item in different page, even if page is full. (Make sure you don't already have that item in different pages, aka see duplication log).
 
 ## Proof of concept
   <details>

+ 3 - 1
index.js

@@ -31,6 +31,7 @@ module.exports = function AutoBank(mod) {
 		RmvFromBl = false,
 		curBankContractId = -1,
 		lastBankedPageOffset = -1,
+		warningStack = -1,
 		QueuedDups = new Map(),
 		AllCurBankItems = new Map()
 
@@ -133,7 +134,8 @@ module.exports = function AutoBank(mod) {
 		resetValues = () => {
 			if (AddToBl) toggleAddToBl()
 			if (RmvFromBl) toggleRmvFromBl()
-			if (QueuedDups.size) {
+			if (QueuedDups.size && warningStack !== QueuedDups.size) {
+				warningStack = QueuedDups.size
 				Msg(`[Warning] <font color="#FE6F5E">Duplicate</font> items were found in your bank (page:line:slot).`)
 				if (QueuedDups.size < 50)
 					for (const d of QueuedDups.values())

+ 2 - 2
manifest.json

@@ -1,7 +1,7 @@
 {
     "files": {
-        "README.md": "69f58c69d551b87399a7586c9f8ffdb5ebba27843ccde90eefaee3394134e4cb",
-        "index.js": "b587aefc52287c4132719651a8c171dd58958b7b1df1a5aceb1b9b7b7e5149c5",
+        "README.md": "3e46f59df7ecec1b80dcc6c4943149cd7eae31e2f90e804f98dbdca1bd555574",
+        "index.js": "9b06508e1f65150618d843a0b65b05091766b6a034117f3ddb7da158cb4cec1c",
         "module.json": "df54235a322877d003fa9a33d00cc19aaa8fb0808782399179e34d4e191fba8a",
         "package.json": "b9e2b74cb3dfef6d72d3829b2df3ca9d516c84e40daf22c8d141151c33769396"
     },