Browse Source

this is better

TeraProxy 8 years ago
parent
commit
0ef41da2b8
2 changed files with 6 additions and 5 deletions
  1. 5 4
      index.js
  2. 1 1
      manifest.json

+ 5 - 4
index.js

@@ -17,7 +17,8 @@ module.exports = function Essentials(mod) {
 		interval = null,
 		interval = null,
 		enabled = true,
 		enabled = true,
 		abnormalities = {},
 		abnormalities = {},
-		counter = 0
+		counter = 0,
+		resetcount = null
 
 
 	// ############# //
 	// ############# //
 	// ### Hooks ### //
 	// ### Hooks ### //
@@ -101,14 +102,14 @@ module.exports = function Essentials(mod) {
 
 
 	function useItem(item) {
 	function useItem(item) {
 		counter++
 		counter++
-		if(counter > 3) {
+		if(counter > 5) {
 			let missing = (item == mod.settings.nostrum) ? 'Nostrums' : 'Crystalbinds'
 			let missing = (item == mod.settings.nostrum) ? 'Nostrums' : 'Crystalbinds'
 			enabled = false
 			enabled = false
 			mod.command.message('You ran out of ' + missing + ' (ID: ' + item + '). Essentials has been disabled. Please restock and enable the module again by typing "essentials" in this chat.')
 			mod.command.message('You ran out of ' + missing + ' (ID: ' + item + '). Essentials has been disabled. Please restock and enable the module again by typing "essentials" in this chat.')
 			console.log('You ran out of ' + missing + ' (ID: ' + item + '). Essentials has been disabled. Please restock and enable the module again by typing "essentials" in proxy chat.')
 			console.log('You ran out of ' + missing + ' (ID: ' + item + '). Essentials has been disabled. Please restock and enable the module again by typing "essentials" in proxy chat.')
-			setTimeout(() => { counter = 0 }, 6000)
 			return
 			return
 		}
 		}
+		if(!resetcount) resetcount = setTimeout(() => { counter = 0; resetcount = null }, 15000)
 		mod.toServer('C_USE_ITEM', 3, {
 		mod.toServer('C_USE_ITEM', 3, {
 			gameId: mod.game.me.gameId,
 			gameId: mod.game.me.gameId,
 			id: item,
 			id: item,
@@ -127,7 +128,7 @@ module.exports = function Essentials(mod) {
 	
 	
 	function start() {
 	function start() {
 		stop()
 		stop()
-		interval = setInterval(checkItems, 1000)
+		interval = setInterval(checkItems, 1500)
 	}
 	}
 
 
 	function stop() {
 	function stop() {

+ 1 - 1
manifest.json

@@ -6,7 +6,7 @@
 			"overwrite": false,
 			"overwrite": false,
 			"hash": "a74387d37fd9a2823c4d0bad54ede9279a51595eb59db4e5abfb3b0c0f695628"
 			"hash": "a74387d37fd9a2823c4d0bad54ede9279a51595eb59db4e5abfb3b0c0f695628"
 		},
 		},
-		"index.js": "c5e16a069164d2879994c43322154ba757171297849b5643715bfcd299c3b0a1",
+		"index.js": "9582629ba5f3cf0a7523c87ee286dcbac9f25666675550ede349d5304f8a3dd7",
 		"module.json": "ff65da8b58525c2468a904b0c5cda7490b98d395dd352dcc12bf58ca67faf3cb",
 		"module.json": "ff65da8b58525c2468a904b0c5cda7490b98d395dd352dcc12bf58ca67faf3cb",
 		"settings_migrator.js": "1e910f071a6542ea586144b5b8b57e2be8cc5cd196244b0ef294eca578c8eca5"
 		"settings_migrator.js": "1e910f071a6542ea586144b5b8b57e2be8cc5cd196244b0ef294eca578c8eca5"
 	},
 	},