TeraProxy лет назад: 9
Родитель
Сommit
b8bd2eaf3a
2 измененных файлов с 30 добавлено и 17 удалено
  1. 14 1
      README.md
  2. 16 16
      index.js

+ 14 - 1
README.md

@@ -14,9 +14,22 @@ Any other input returns a summary of above commands in the game.
 Alternative commands in all other chats:  
 Alternative commands in all other chats:  
 * !essentials - Toggles between "on" and "off" state  
 * !essentials - Toggles between "on" and "off" state  
   
   
+Support for Pinkie Pie's command module:  
+* /proxy afk - Toggles between "on" and "off" state  
+  
 ## Safety
 ## Safety
 Whatever you send to "!Essentials" ingame is intercepted client-side. The chat is NOT sent to the server.  
 Whatever you send to "!Essentials" ingame is intercepted client-side. The chat is NOT sent to the server.  
 The script makes sure that you are not dead, mounted, in a battleground or in a negotiation before using an item.  
 The script makes sure that you are not dead, mounted, in a battleground or in a negotiation before using an item.  
   
   
 ## Credits  
 ## Credits  
-Contains code from true-everful-nostrum by Pinkie Pie https://github.com/pinkipi  
+Contains code from true-everful-nostrum by Pinkie Pie https://github.com/pinkipi  
+  
+## Changelog
+### 1.2.0
+* [+] Added support for Pinkie Pie's command module which is now a requirement
+* [+] Added randomized timers
+* [-] Removed hiding messages and buff timer functions
+### 1.1.0
+* [+] Added !essentials command to toggle between "on" and "off" in non-whisper chats
+### 1.0.0
+* [*] Initial Release

+ 16 - 16
index.js

@@ -5,8 +5,7 @@ const ITEMS_NOSTRUM = 184659, // EU 152898, NA 184659, RU 201005
 	BUFF_NOSTRUM_H = 4031,
 	BUFF_NOSTRUM_H = 4031,
 	BUFF_CCB = 4610,
 	BUFF_CCB = 4610,
 	RANDOM_MIN_MAX = [600000, 1500000], // Random Nostrum reapplication time between 10 and 25 minutes
 	RANDOM_MIN_MAX = [600000, 1500000], // Random Nostrum reapplication time between 10 and 25 minutes
-	RANDOM_SHORT = [15000, 20000], // Random Nostrum reapplication time after loading screen between 15 and 20 seconds
-	BUFF_GODDESS = 1134
+	RANDOM_SHORT = [15000, 20000] // Random Nostrum reapplication time after loading screen between 15 and 20 seconds
 
 
 module.exports = function Essentials(dispatch) {
 module.exports = function Essentials(dispatch) {
 	let cid = null,
 	let cid = null,
@@ -67,7 +66,7 @@ module.exports = function Essentials(dispatch) {
 		if(event.target.equals(cid) && alive != event.alive) {
 		if(event.target.equals(cid) && alive != event.alive) {
 			setTimeout(function () {
 			setTimeout(function () {
 				nostrum(!(alive = event.alive))
 				nostrum(!(alive = event.alive))
-			}, 1900)
+			}, 2000)
 			
 			
 			if(!alive) {
 			if(!alive) {
 				nextUse = 0
 				nextUse = 0
@@ -75,11 +74,6 @@ module.exports = function Essentials(dispatch) {
 			}
 			}
 		}
 		}
 	})
 	})
-	
-	dispatch.hook('C_USE_ITEM', (event) => {
-		if(event.item == 200529 || event.item == 60260 || event.item == 160322)
-			nostrum(true)
-	})
 
 
 	dispatch.hook('S_MOUNT_VEHICLE', 1, mount.bind(null, true))
 	dispatch.hook('S_MOUNT_VEHICLE', 1, mount.bind(null, true))
 	dispatch.hook('S_UNMOUNT_VEHICLE', 1, mount.bind(null, false))
 	dispatch.hook('S_UNMOUNT_VEHICLE', 1, mount.bind(null, false))
@@ -105,14 +99,6 @@ module.exports = function Essentials(dispatch) {
 				ccb()
 				ccb()
 			}
 			}
 		}
 		}
-		if(event.target.equals(cid) && (event.id == BUFF_GODDESS)) {
-			if(type == 'S_ABNORMALITY_BEGIN') {
-				nostrum(true)
-			}
-			else if (type == 'S_ABNORMALITY_END') {
-				nostrum()
-			}
-		}
 	}
 	}
 
 
 	function mount(enter, event) {
 	function mount(enter, event) {
@@ -227,4 +213,18 @@ module.exports = function Essentials(dispatch) {
 			return false
 			return false
 		}
 		}
 	})
 	})
+	
+	const command = Command(dispatch)
+	command.add('essentials', function() {
+		if(!enabled) {
+			enabled = true
+			message('Essentials <font color="#56B4E9">enabled</font>.')
+			console.log('Essentials enabled.')
+		}
+		else {
+			enabled = false
+			message('Essentials <font color="#E69F00">disabled</font>.')
+			console.log('Essentials disabled.')
+		}
+	})
 }
 }