****** links are not usually allowed (usullay the endpoints are used) here is the main class
Code://Core plugin module import { NrPlugin, HookPacket, Client, Log, LogLevel, PacketType } from './../core/plugin-module'; //Portal management import { UpdatePacket } from './../networking/packets/incoming/update-packet'; import { ObjectStatusData } from './../networking/data/object-status-data'; import { IPlayerData, getDefaultPlayerData } from './../models/playerdata'; import { ResourceManager } from './../core/resource-manager'; var fs = require("fs"); const jsonContent = fs.readFileSync("./../nrelay/player-sniper-config.json"); const config = JSON.parse(jsonContent); /* * v0.1.3 * Removed ******* support from the plugin */ @NRPlugin({ name: 'Player Sniper', author: 'Ark' // <-- Wow what a cool cunt! }) export default class PlayerSniper { private lastKey: { [guid: string]: number } constructor () { this.lastKey = {}; } @hookPacket(PacketType.UPDATE) onUpdate(client: Client, update: UpdatePacket): void{ // Looping thru names and new objects to find the names for (let i = 0; i < config.list.length; i++){ for (let k = 0; k < update.newObjects.length; k++){ var player = ObjectStatusData.processObjectStatus(update.newObjects[k].status); if (player.name != '' && player.name.toLowerCase() == config.list[i].name.toLowerCase()){ console.log(client.alias + ' ' ,'Found: '+ player.name + ' : ' + config.list[i].type); } } } // Looping thru and looking for new portals for (let i = 0; i < config.portals.length; i++){ for (let k = 0; k < update.newObjects.length; k++){ if (update.newObjects[k].objectType == config.portals[i].id && update.newObjects[k].status.objectId != this.lastKey[client.alias]){ this.lastKey[client.alias] = update.newObjects[k].status.objectId; console.log(client.alias + ' Found: ' + config.portals[i].name); } } } } }
can you show what you had in the palyer-sniper-config file?
EDIT: ok after trying to run it i found 2 typos in your code
you have to fix NRPlugin to NrPlugin in
and same for hookPacket to HookPacket inCode:@NRPlugin({ name: 'Player Sniper', author: 'Ark' // <-- Wow what a cool cunt!
- - - Updated - - -Code:@hookPacket(PacketType.UPDATE)
I'm still getting Error while loading player-sniper.js
any idea how to fix it?
Last edited by Fabi0wZ1; 03-25-2018 at 09:13 PM.
Run nrelay with the --debug flag for more detailed info. It is prob because you are missing the json file that contains the names look at the code and you will see references to `config` so things like `config.players[i].name` is an array names of tracked players, the version you have also has portal types ids and names in the same file allong with the asset location I used at the top of the embeds in my *******, I'm just gonna make a sight for it.
the name of the file that he used was player-sniper.ts, but since this is the mainclass you can rename to whatever you want
as for the acc-config.json it is modified like this:
and you repeat that with different account emails/passwords and servers for every server you want a mule in. It's important to make the ALIAS something like the server name because in the console you will get alias found: playerCode:{ "buildVersion": "X23.1.0", "accounts": [ { "alias": "EUSW", "guid": "yourmule1", "password": "superpassword", "serverPref": "EuropeSouthWest" } ] }
so if you have 20 clients running it's good to have each identified for whenever it finds who you want it will say "eusw found: player"
thank you. I already have my acc-config.json set up just like u said with all my accounts. I thought it needed additional changes specific to player sniper
i guess all we need now is player-sniper-config.json :P
EDIT: will pasting Ark's code into regular notepad and saving it with a .ts file extension work, or do i need notepad++ or something
Last edited by iNutsack; 03-25-2018 at 10:02 PM.
i actually modified it so it doesn't need the extra file, just created a var inside the file with all the player names i want to track (its stupid because i will have to compile it again everytime i want to add someone) and the tracker was working, but cmd is giving me Error while calling UPDATE hook on PlayerSniper
but the tracker is working, so idk whats wrong now. im trying to figure it out lol
Last edited by Fabi0wZ1; 03-25-2018 at 09:59 PM.
sweet. if you get it working, could you post the new code?
ive just been following instructions this whole time, i have no idea how this works, if that wasnt already obvious
i don't think it's ok for me to post something that's not created by me, lets wait for ArkMods to answer us
because if he didn't post it by now it's probably because he doesn't want to or else he would've just posted the account configs along with main class
Last edited by Fabi0wZ1; 03-25-2018 at 10:23 PM.