Browse Source

1.2.3

* [+] You won't be logged out anymore when other players or NPCs move you (thanks to Owyn)
* [+] Now supports auto-updating via Caali's tera-proxy
TeraProxy 8 years ago
parent
commit
5fa6f338ad
4 changed files with 49 additions and 23 deletions
  1. 25 12
      README.md
  2. 9 11
      index.js
  3. 11 0
      manifest.json
  4. 4 0
      module.json

+ 25 - 12
README.md

@@ -1,30 +1,43 @@
 ##### :heavy_exclamation_mark: Status :heavy_exclamation_mark:
-Working on NA Godsfall patch with the latest https://github.com/meishuu/tera-data.  
-Please always keep your tera-data up-to-date.  
-Other regions will work if the opcodes are mapped but I personally only test modules on NA.  
+Should work on all regions as long as the opcodes are mapped but I personally only test modules on NA with Caali's tera-proxy: https://discord.gg/maqBmJV  
+
+##### :heavy_exclamation_mark: Installation for Caali's tera-proxy :heavy_exclamation_mark:
+1) Download AFKer: https://github.com/TeraProxy/AFKer/archive/master.zip
+2) Extract the contents of the zip file into "\tera-proxy\bin\node_modules\"
+3) Done! (the module will auto-update when a new version is released)
+
+##### :heavy_exclamation_mark: Installation for PinkiePie's tera-proxy :heavy_exclamation_mark:
+1) Update your tera-data: https://github.com/meishuu/tera-data
+2) Download AFKer: https://github.com/TeraProxy/AFKer/archive/master.zip
+3) Extract the contents of both zip files into "\tera-proxy\bin\node_modules\"
+4) Done!
+5) Check back here once in a while for updates
   
 If you enjoy my work and wish to support future development, feel free to drop me a small donation: [![Donate](https://www.paypalobjects.com/webstatic/en_US/i/buttons/PP_logo_h_100x26.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=A3KBZUCSEQ5RJ&lc=US&item_name=TeraProxy&curency_code=USD&no_note=1&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
-  
+
 # AFKer
-A tera-proxy module that prevents you from getting back to the character select screen. 
+A tera-proxy module that prevents you from getting back to the character select screen.  
 This has the side effect that the server's AFK check will not kick you out of the game.  
-  
+
 ## Usage
 The script is enabled by default and will prevent you from getting logged out when you are standing still for an hour.  
-Simply moving your character will make you able to go back to character selection and reset the 1 hour timer.  
+Simply moving your character will reset the 1 hour timer and make you able to go back to character selection.  
   
 While in game, open a proxy chat session by typing "/proxy" or "/8" in chat and hitting the space bar.  
 This serves as the script's command interface.  
 The following commands are supported:  
   
-* afk - enable/disable AFKer  
-  
+* afk - enable/disable AFKer
+
 ## Safety
 Whatever you send to the proxy chat in game is intercepted client-side. The chat is NOT sent to the server.  
-  
+
 ## Changelog
+### 1.2.3
+* [+] You won't be logged out anymore when other players or NPCs move you (thanks to Owyn)
+* [+] Now supports auto-updating via Caali's tera-proxy
 ### 1.2.2
-* [*] Updated hook versions for compatibility with the latest Tera-Proxy programs
+* [*] Updated hook versions for compatibility with the latest tera-proxy
 ### 1.2.1
 * [*] Some code cleanup
 * [*] Full conversion to Pinkie Pie's command module
@@ -35,4 +48,4 @@ Whatever you send to the proxy chat in game is intercepted client-side. The chat
 ### 1.1.0
 * [+] Added !afk command to toggle between "on" and "off" in non-whisper chats
 ### 1.0.0
-* [*] Initial Release
+* [~] Initial Release

+ 9 - 11
index.js

@@ -1,26 +1,24 @@
-// Version 1.2.2
+// Version 1.2.3
 
 const Command = require('command')
 
 module.exports = function AFKer(dispatch) {
 	let enabled = true,
-		afk = false,
-		afkCheck = null
-	
-	dispatch.hook('C_PLAYER_LOCATION', 'raw', () => {
-		clearTimeout(afkCheck)
-		afk = false
-		afkCheck = setTimeout(() => {afk = true}, 3600000) // 1 hour
+		lasttimemoved = Date.now()
+
+	dispatch.hook('C_PLAYER_LOCATION', 5, event => {
+		if([0,1,5,6].indexOf(event.type) > -1) // running / walking / jumping / jumping (steep terrain)
+			lasttimemoved = Date.now()
 	})
 
 	dispatch.hook('C_RETURN_TO_LOBBY', 'raw', () => {
-		if (enabled && afk) return false // Prevents you from being automatically logged out while AFK
+		if (enabled && Date.now() - lasttimemoved >= 3600000) return false // Prevents you from being logged out after not moving for 1 hour
 	})
-  
+
 	// ################# //
 	// ### Chat Hook ### //
 	// ################# //
-	
+
 	const command = Command(dispatch)
 	command.add('afk', () => {
 		enabled = !enabled

+ 11 - 0
manifest.json

@@ -0,0 +1,11 @@
+{
+	"files": {
+		"index.js": "9fb22bb28531cb9388fa27fdc081f19e05329a734fbc82895bcbb315a81d9e90",
+		"LICENSE": "589ed823e9a84c56feb95ac58e7cf384626b9cbf4fda2a907bc36e103de1bad2",
+		"README.md": "ab2916bdf263e2b6eddaa8965d372967c8a925e47cdfceb8103f70b0aefb282d",
+		"module.json": "09393206e0a735d475c615dfe6675648073beb6de495a23fa175ec20599e310d"
+	},
+	"defs": {
+		"C_PLAYER_LOCATION": 5
+	}
+}

+ 4 - 0
module.json

@@ -0,0 +1,4 @@
+{
+    "servers": ["https://raw.githubusercontent.com/TeraProxy/AFKer/master/"],
+    "supportUrl": "https://github.com/TeraProxy/AFKer/issues"
+}