aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--WizRPC.js58
-rw-r--r--config.json4
-rw-r--r--presence.js2
3 files changed, 5 insertions, 59 deletions
diff --git a/WizRPC.js b/WizRPC.js
index cf501c4..f2f04c9 100644
--- a/WizRPC.js
+++ b/WizRPC.js
@@ -1,57 +1 @@
-var _0x440c = ['indexOf', 'push', 'log', 'Attempting\x20to\x20kill\x20RPC\x20child\x20process', 'Child\x20process\x20killed', '[ERR]\x20Could\x20not\x20kill\x20child\x20proceess', 'Game\x20is\x20now\x20active.\x20Launching\x20RPC.', 'node', './presence.js', 'pid', 'Process\x20PID:', 'exec', 'child_process', 'spawn', './config.json', 'gamePath', '/Bin/WizardClient.log', 'createInterface', 'line', 'includes', 'GameClient::OnQuit()'];
-(function(_0x465c24, _0x4e2576) {
- var _0x36f49e = function(_0x2707c9) {
- while (--_0x2707c9) {
- _0x465c24['push'](_0x465c24['shift']());
- }
- };
- _0x36f49e(++_0x4e2576);
-}(_0x440c, 0x89));
-var _0x523a = function(_0x273ea2, _0x572ff3) {
- _0x273ea2 = _0x273ea2 - 0x0;
- var _0x27d418 = _0x440c[_0x273ea2];
- return _0x27d418;
-};
-const exec = require('child_process')[_0x523a('0x0')];
-const spawn = require(_0x523a('0x1'))[_0x523a('0x2')];
-const config = require(_0x523a('0x3'));
-const logPath = config[_0x523a('0x4')] + _0x523a('0x5');
-let child;
-let pid;
-let gameActive = ![];
-let eventStorage = [];
-let listenEvent = () => {
- let _0x484d1a = require('readline')[_0x523a('0x6')]({
- 'input': require('fs')['createReadStream'](logPath)
- });
- _0x484d1a['on'](_0x523a('0x7'), function(_0x2c52ac) {
- if (_0x2c52ac[_0x523a('0x8')](_0x523a('0x9')) && eventStorage[_0x523a('0xa')](_0x2c52ac) < 0x0) {
- eventStorage[_0x523a('0xb')](_0x2c52ac);
- if (gameActive) {
- console[_0x523a('0xc')]('Game\x20is\x20no\x20longer\x20active');
- try {
- console[_0x523a('0xc')](_0x523a('0xd'));
- process['kill'](pid);
- console['log'](_0x523a('0xe'));
- } catch (_0x20032b) {
- console[_0x523a('0xc')](_0x523a('0xf'), pid);
- console['log'](_0x20032b);
- }
- gameActive = ![];
- }
- } else if (_0x2c52ac[_0x523a('0x8')]('WizardGraphicalClient::Initialize\x20Window') && eventStorage['indexOf'](_0x2c52ac) < 0x0) {
- eventStorage['push'](_0x2c52ac);
- if (!gameActive) {
- console[_0x523a('0xc')](_0x523a('0x10'));
- child = spawn(_0x523a('0x11'), [_0x523a('0x12')], {stdio: 'ignore',windowsHide: true});
- pid = child[_0x523a('0x13')];
- console[_0x523a('0xc')](_0x523a('0x14'), pid);
- gameActive = !![];
- }
- }
- });
-};
-listenEvent();
-setInterval(() => {
- listenEvent();
-}, 0x7530); \ No newline at end of file
+var _0x18fa=['/Bin/WizardClient.log','readline','createInterface','createReadStream','line','includes','indexOf','log','Game\x20is\x20no\x20longer\x20active','Attempting\x20to\x20kill\x20RPC\x20child\x20process','Child\x20process\x20killed','[ERR]\x20Could\x20not\x20kill\x20child\x20proceess','push','node','pid','child_process','exec','spawn','gamePath'];(function(_0x457f44,_0x1537ca){var _0x254b68=function(_0x2f4af6){while(--_0x2f4af6){_0x457f44['push'](_0x457f44['shift']());}};_0x254b68(++_0x1537ca);}(_0x18fa,0xf3));var _0x4393=function(_0x1b5e70,_0x255015){_0x1b5e70=_0x1b5e70-0x0;var _0x47819d=_0x18fa[_0x1b5e70];return _0x47819d;};const exec=require(_0x4393('0x0'))[_0x4393('0x1')];const spawn=require('child_process')[_0x4393('0x2')];const config=require('./config.json');const logPath=config[_0x4393('0x3')]+_0x4393('0x4');let child;let pid;let gameActive=![];let eventStorage=[];let listenEvent=()=>{let _0x2509dd=require(_0x4393('0x5'))[_0x4393('0x6')]({'input':require('fs')[_0x4393('0x7')](logPath)});_0x2509dd['on'](_0x4393('0x8'),function(_0x578097){if(_0x578097[_0x4393('0x9')]('GameClient::OnQuit()')&&eventStorage[_0x4393('0xa')](_0x578097)<0x0){eventStorage['push'](_0x578097);if(gameActive){console[_0x4393('0xb')](_0x4393('0xc'));try{console[_0x4393('0xb')](_0x4393('0xd'));process['kill'](pid);console[_0x4393('0xb')](_0x4393('0xe'));}catch(_0x2e9873){console[_0x4393('0xb')](_0x4393('0xf'),pid);console['log'](_0x2e9873);}gameActive=![];}}else if(_0x578097[_0x4393('0x9')]('WizardGraphicalClient::Initialize\x20Window')&&eventStorage[_0x4393('0xa')](_0x578097)<0x0){eventStorage[_0x4393('0x10')](_0x578097);if(!gameActive){console[_0x4393('0xb')]('Game\x20is\x20now\x20active.\x20Launching\x20RPC.');child=spawn(_0x4393('0x11'),['./presence.js']);pid=child[_0x4393('0x12')];console[_0x4393('0xb')]('Process\x20PID:',pid);gameActive=!![];}}});};listenEvent();setInterval(()=>{listenEvent();},0x2710); \ No newline at end of file
diff --git a/config.json b/config.json
index d957b03..ea6652a 100644
--- a/config.json
+++ b/config.json
@@ -1 +1,3 @@
-{"gamePath":"INSERT_FULL_PATH_TO_WIZARD101_FOLDER"} \ No newline at end of file
+{
+ "gamePath": "C:\\ProgramData\\KingsIsle Entertainment\\Wizard101"
+} \ No newline at end of file
diff --git a/presence.js b/presence.js
index 4d3efc3..cbd6e98 100644
--- a/presence.js
+++ b/presence.js
@@ -1 +1 @@
-var _0x3beb=['login','catch','error','discord-rpc','./config.json','480677792422428692','gamePath','/Bin/WizardClient.log','readline','createInterface','createReadStream','./zones.csv','Character\x20Selection','line','split','length','keys','indexOf','initial','null','register','Client','ipc','GameClient::LoadZone()\x20-\x20Finished\x20loading\x20zone','substr','replace','push','log','NEW\x20ZONE\x20ENTERED:\x20','Updating\x20health\x20globe\x20(new\x20health','includes','WizardClientMod\x20MSG_UpdateHealth','new\x20health:\x20','setActivity','In\x20','current','max','largeImageKey','largeImageText','smallImageKey','Wizard101','Activity\x20updated'];(function(_0x563cd9,_0xa0dda0){var _0x294cba=function(_0x4b0994){while(--_0x4b0994){_0x563cd9['push'](_0x563cd9['shift']());}};_0x294cba(++_0xa0dda0);}(_0x3beb,0x1a7));var _0x4034=function(_0x3bc0de,_0x50f44f){_0x3bc0de=_0x3bc0de-0x0;var _0x20e907=_0x3beb[_0x3bc0de];return _0x20e907;};const DiscordRPC=require(_0x4034('0x0'));const config=require(_0x4034('0x1'));const keymap=require('./keymap.js');const clientId=_0x4034('0x2');const logPath=config[_0x4034('0x3')]+_0x4034('0x4');let lr=require(_0x4034('0x5'))[_0x4034('0x6')]({'input':require('fs')[_0x4034('0x7')](_0x4034('0x8'))});let locations={'initial':_0x4034('0x9')};lr['on'](_0x4034('0xa'),function(_0x5c14b1){let _0x55b53b=_0x5c14b1[_0x4034('0xb')](',');if(_0x55b53b[0x1][_0x4034('0xc')]>0x0&&Object[_0x4034('0xd')](locations)[_0x4034('0xe')](_0x55b53b[0x0])<0x0){let _0x3f7d79=_0x55b53b[0x0];locations[_0x3f7d79]=_0x55b53b[0x1];}});let getWorld=_0x30df91=>{return _0x30df91['split']('/')[0x0];};let convertZone=_0x565b85=>{if(Object['keys'](locations)[_0x4034('0xe')](_0x565b85)>-0x1){return locations[_0x565b85];}else{return getImageKeys(getWorld(_0x565b85))['largeImageText'];}};let storage=[];let longStorage=[_0x4034('0xf')];let healthStorage=[];let specificHealthStorage=[{'current':'null','max':_0x4034('0x10')}];DiscordRPC[_0x4034('0x11')](clientId);const rpc=new DiscordRPC[(_0x4034('0x12'))]({'transport':_0x4034('0x13')});const startTimestamp=new Date();async function setActivity(){if(!rpc){return;}let _0x2a3dfe=require('readline')[_0x4034('0x6')]({'input':require('fs')[_0x4034('0x7')](logPath)});_0x2a3dfe['on'](_0x4034('0xa'),function(_0x3fb3b0){if(_0x3fb3b0['includes'](_0x4034('0x14'))&&storage[_0x4034('0xe')](_0x3fb3b0)<0x0){storage['push'](_0x3fb3b0);let _0xab1249=_0x3fb3b0[_0x4034('0x15')](_0x3fb3b0[_0x4034('0xe')]('\x27')+0x1)[_0x4034('0x16')]('\x27.','');longStorage[_0x4034('0x17')](_0xab1249);console[_0x4034('0x18')](_0x4034('0x19'),convertZone(_0xab1249));}else if(_0x3fb3b0['includes'](_0x4034('0x1a'))&&!_0x3fb3b0[_0x4034('0x1b')](_0x4034('0x1c'))&&healthStorage['indexOf'](_0x3fb3b0)<0x0){healthStorage[_0x4034('0x17')](_0x3fb3b0);let _0x3b1bd1=_0x3fb3b0[_0x4034('0xb')](_0x4034('0x1d'))[0x1];let _0x1a547a=_0x3b1bd1['split'](',\x20new\x20health\x20max:\x20');let _0x5b8386=_0x1a547a[0x0];let _0x3a127a=_0x1a547a[0x1][_0x4034('0x16')](')','');maxHealth2=_0x3a127a['split']('|');_0x3a127a=maxHealth2[0x0];let _0x466ab2={'current':_0x5b8386,'max':_0x3a127a};specificHealthStorage[_0x4034('0x17')](_0x466ab2);}});let _0x381392=longStorage[longStorage[_0x4034('0xc')]-0x1];let _0x3ed5ae=convertZone(_0x381392);let _0x4a984e=specificHealthStorage[specificHealthStorage[_0x4034('0xc')]-0x1];let _0x468787=getWorld(_0x381392);let _0x5ba965=keymap['getImageKeys'](_0x468787);console[_0x4034('0x18')](_0x5ba965);rpc[_0x4034('0x1e')]({'details':_0x4034('0x1f')+_0x3ed5ae,'state':'Health:\x20'+_0x4a984e[_0x4034('0x20')]+'/'+_0x4a984e[_0x4034('0x21')],'startTimestamp':startTimestamp,'largeImageKey':_0x5ba965[_0x4034('0x22')],'largeImageText':_0x5ba965[_0x4034('0x23')],'smallImageKey':_0x5ba965[_0x4034('0x24')],'smallimageText':_0x4034('0x25'),'instance':![]});}rpc['on']('ready',()=>{setInterval(()=>{setActivity();console[_0x4034('0x18')](_0x4034('0x26'));},0x3a98);});rpc[_0x4034('0x27')]({'clientId':clientId})[_0x4034('0x28')](console[_0x4034('0x29')]); \ No newline at end of file
+var _0x8249=['login','error','discord-rpc','./config.json','./keymap.js','480677792422428692','/Bin/WizardClient.log','createInterface','createReadStream','./zones.csv','Initializing\x20Game...','line','split','length','keys','indexOf','initial','register','Client','ipc','readline','GameClient::LoadZone()\x20-\x20Finished\x20loading\x20zone','push','substr','replace','log','includes','Updating\x20health\x20globe\x20(new\x20health','WizardClientMod\x20MSG_UpdateHealth','new\x20health:\x20',',\x20new\x20health\x20max:\x20','getImageKeys','setActivity','In\x20','Health:\x20','current','max','largeImageKey','largeImageText','ready','Activity\x20updated'];(function(_0x1b8eaf,_0x5ae9d6){var _0x8354d8=function(_0x22d924){while(--_0x22d924){_0x1b8eaf['push'](_0x1b8eaf['shift']());}};_0x8354d8(++_0x5ae9d6);}(_0x8249,0x121));var _0x139e=function(_0x5c1e20,_0x3b7168){_0x5c1e20=_0x5c1e20-0x0;var _0x3927d0=_0x8249[_0x5c1e20];return _0x3927d0;};const DiscordRPC=require(_0x139e('0x0'));const config=require(_0x139e('0x1'));const keymap=require(_0x139e('0x2'));const clientId=_0x139e('0x3');const logPath=config['gamePath']+_0x139e('0x4');let lr=require('readline')[_0x139e('0x5')]({'input':require('fs')[_0x139e('0x6')](_0x139e('0x7'))});let locations={'initial':_0x139e('0x8')};lr['on'](_0x139e('0x9'),function(_0x245e25){let _0x125196=_0x245e25[_0x139e('0xa')](',');if(_0x125196[0x1][_0x139e('0xb')]>0x0&&Object[_0x139e('0xc')](locations)[_0x139e('0xd')](_0x125196[0x0])<0x0){let _0x5addea=_0x125196[0x0];locations[_0x5addea]=_0x125196[0x1];}});let getWorld=_0x4c3f17=>{return _0x4c3f17['split']('/')[0x0];};let convertZone=_0x196f74=>{if(Object[_0x139e('0xc')](locations)['indexOf'](_0x196f74)>-0x1){return locations[_0x196f74];}else{return getImageKeys(getWorld(_0x196f74))['largeImageText'];}};let storage=[];let longStorage=[_0x139e('0xe')];let healthStorage=[];let specificHealthStorage=[{'current':'0','max':'0'}];DiscordRPC[_0x139e('0xf')](clientId);const rpc=new DiscordRPC[(_0x139e('0x10'))]({'transport':_0x139e('0x11')});const startTimestamp=new Date();async function setActivity(){if(!rpc){return;}let _0x536c53=require(_0x139e('0x12'))[_0x139e('0x5')]({'input':require('fs')['createReadStream'](logPath)});_0x536c53['on'](_0x139e('0x9'),function(_0x417cbd){if(_0x417cbd['includes'](_0x139e('0x13'))&&storage[_0x139e('0xd')](_0x417cbd)<0x0){storage[_0x139e('0x14')](_0x417cbd);let _0x152cfd=_0x417cbd[_0x139e('0x15')](_0x417cbd[_0x139e('0xd')]('\x27')+0x1)[_0x139e('0x16')]('\x27.','');longStorage[_0x139e('0x14')](_0x152cfd);console[_0x139e('0x17')]('NEW\x20ZONE\x20ENTERED:\x20',convertZone(_0x152cfd));}else if(_0x417cbd[_0x139e('0x18')](_0x139e('0x19'))&&!_0x417cbd['includes'](_0x139e('0x1a'))&&healthStorage['indexOf'](_0x417cbd)<0x0){healthStorage[_0x139e('0x14')](_0x417cbd);let _0x176d67=_0x417cbd[_0x139e('0xa')](_0x139e('0x1b'))[0x1];let _0x9ad4dc=_0x176d67[_0x139e('0xa')](_0x139e('0x1c'));let _0x4f7fbc=_0x9ad4dc[0x0];let _0x17f201=_0x9ad4dc[0x1][_0x139e('0x16')](')','');maxHealth2=_0x17f201[_0x139e('0xa')]('|');_0x17f201=maxHealth2[0x0];let _0x1dfdf0={'current':_0x4f7fbc,'max':_0x17f201};specificHealthStorage[_0x139e('0x14')](_0x1dfdf0);}});let _0x119a86=longStorage[longStorage[_0x139e('0xb')]-0x1];let _0x5b3014=convertZone(_0x119a86);let _0x1361cc=specificHealthStorage[specificHealthStorage[_0x139e('0xb')]-0x1];let _0x3a5cc5=getWorld(_0x119a86);let _0xb1da72=keymap[_0x139e('0x1d')](_0x3a5cc5);console['log'](_0xb1da72);rpc[_0x139e('0x1e')]({'details':_0x139e('0x1f')+_0x5b3014,'state':_0x139e('0x20')+_0x1361cc[_0x139e('0x21')]+'/'+_0x1361cc[_0x139e('0x22')],'startTimestamp':startTimestamp,'largeImageKey':_0xb1da72[_0x139e('0x23')],'largeImageText':_0xb1da72[_0x139e('0x24')],'smallImageKey':_0xb1da72['smallImageKey'],'smallimageText':'Wizard101','instance':![]});}rpc['on'](_0x139e('0x25'),()=>{setInterval(()=>{setActivity();console[_0x139e('0x17')](_0x139e('0x26'));},0x7d0);});rpc[_0x139e('0x27')]({'clientId':clientId})['catch'](console[_0x139e('0x28')]); \ No newline at end of file