Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    Killer Be Killed's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    212
    Reputation
    53
    Thanks
    2,352
    My Mood
    Asleep

    [TypeScript/Nodejs] Open Source headless modular client

    In my spare time I've been developing a headless modular client in TypeScript. I've decided to release it here as it's pretty functional now and can be fun to play around with if you know a little bit of JavaScript/TypeScript.

    This was mostly inspired by the C++ clientless made by @toddddd so thanks to him for making his code open source.

    I don't really know C++ so I wanted to recreate it with Node, since it has great built in support for Net Sockets and Buffers, and since it is a fairly large project, TypeScript seemed like a better choice than just plain ES6 JavaScript.

    This project isn't completed yet, quite a few of the packets are still missing implementations. All of the essential packets (like Ack packets) are implemented as well as other frequently used ones such as text and trade packets.
    The GoundTile data is loaded from xml resources currently, but Objects.xml loading still needs to be added.

    The project is modular, so it supports running plugins (similar to KRelay). The project only has one default plugin so far which is more of an example of how to structure plugins.

    The account information is loaded through a JSON file, and it supports running multiple accounts at once. This is the structure of the accounts file:
     
    Code:
    {
        "buildVersion": "X19.0.1",
        "accounts": [
            {
                "guid": "john@email.com",
                "password": "SecretPassWord11",
                "serverPref": "AsiaSouthEast"
            }
        ]
    }


    The client can be run anywhere from the console with a simple command and will connect to the nexus.
    When it starts it will look something like this:


    Side Note
    I called this project nrelay (Nodejs Relay) before JRelay was released, I don't want there to be 3 different 'letter'-relay programs as that is a bit confusing. It's a lot of work to refactor the name everywhere but will probably happen at some point.
    The name is also a tiny bit misleading as it's not actually a relay, but a client. All implemented packets do have a read/write implementation however, so it could be turned in to a relay with minimal extra code (the code could even be in a plugin).

    If you get the client up and running, it won't do much other than sit in the nexus. The default plugin will respond to you if you whisper the client 'hello', so you can test if the client is working or not.



    And here is an example of running more than one client. These bots will just walk in a circle along the edge of the nexus spawn platform.



    The functionality of these bots walking in a circle around the nexus fountains was actually added by making a plugin. This is the source code for the plugin:
     
    Code:
    import { NrPlugin, HookPacket, Packet, PacketType, Client, Log } from './../core/plugin-module';
    
    import { WorldPosData } from './../networking/data/world-pos-data';
    import { NewTickPacket } from './../networking/packets/incoming/newtick-packet';
    
    const path = [
        { x: 129.5824, y: 143.6437 }, // bottom-left
        { x: 138.5885, y: 143.6437 }, // bottom-right
        { x: 138.5885, y: 136.4980 }, // top-right
        { x: 129.5824, y: 136.4980 }  // top-left
    ];
    
     @NRPlugin({
        name: 'Path Walker',
        author: 'tcrane'
    })
    export default class WalkpathPlugin {
    
        private players: {
            [id: number]: any[]
        };
    
        constructor() {
            this.players = {};
        }
    
        @hookPacket(PacketType.NewTick)
        onNewTick(client: Client, newTickPacket: NewTickPacket): void {
            if (!this.players[client.playerData.objectId]) {
                this.players[client.playerData.objectId] = path.slice();
            }
            if (!client.nextPos) {
                const wp = new WorldPosData();
                const point = this.players[client.playerData.objectId].pop();
                this.players[client.playerData.objectId].unshift(point);
                wp.x = point.x;
                wp.y = point.y;
                client.nextPos = wp;
            }
        }
    }


    This project is hosted on my ****** page where you will also find a readme on how to setup and run the client, as well as a large amount of documentation covering how to write plugins, packet types and data structures available to use when making plugins.

    I thought ****** links were not allowed, but have recently seen other posts using ****** links. Just to be safe I won't link the ****** but please let me know if the rules have changed @Raple @Ahlwong
    The ****** endpoint is '/thomas-crane/nrelay'.

    The TypeScript source is attached to this post, but you will need to build the source yourself to run the client. You can look at the included readme file or the ****** to see how to do this. The only thing you need to have installed before running this client is Nodejs

    There is still a fair bit of functionality that can be added to the client, so feel free to open a pull request or an issue if you find a bug.

    Virus Scans
    Jotti. (0/17)
    Virus Total. (0/51)

    The packet ids have been updated to work with build X19.0.2

    @Raple @Ahlwong please move this to the main post

    Virus Scans
    Jotti. (0/18)
    VirusTotal. (0/59)
    <b>Downloadable Files</b> Downloadable Files
    Last edited by Ahlwong; 11-21-2017 at 01:33 AM.

  2. The Following 15 Users Say Thank You to Killer Be Killed For This Useful Post:

    aluminioxx (11-23-2017),CrazyJani (11-18-2017),HYDRONDON (03-08-2018),kiwi5 (03-15-2018),krestian (11-19-2019),Kushala Daora (12-15-2017),laztheripper (02-25-2018),MPAzoh (11-30-2018),Mr_Guy (01-09-2018),panton123 (03-10-2018),PussyPounder1212 (03-08-2018),Sumarey (11-29-2017),swagmedo (11-23-2017),Syntes512 (11-18-2017),zikerob (12-30-2018)

  3. #2
    elisrael's Avatar
    Join Date
    May 2017
    Gender
    male
    Posts
    142
    Reputation
    30
    Thanks
    1,985
    My Mood
    Sleepy
    Very nice, looked at some of the classes looks clean and well documentated , I may try to use this for some bots in the foreseeable future.

  4. #3
    Matthew's Avatar
    Join Date
    Mar 2017
    Gender
    male
    Posts
    5,330
    Reputation
    1162
    Thanks
    1,156
    Very interesting

  5. #4
    SeXZeFPS's Avatar
    Join Date
    Jan 2015
    Gender
    male
    Location
    In your wardrobe
    Posts
    598
    Reputation
    10
    Thanks
    637
    My Mood
    Asleep
    Quote Originally Posted by Killer Be Killed View Post
    In my spare time I've been developing a headless modular client in TypeScript. I've decided to release it here as it's pretty functional now and can be fun to play around with if you know a little bit of JavaScript/TypeScript.

    This was mostly inspired by the C++ clientless made by @toddddd so thanks to him for making his code open source.

    I don't really know C++ so I wanted to recreate it with Node, since it has great built in support for Net Sockets and Buffers, and since it is a fairly large project, TypeScript seemed like a better choice than just plain ES6 JavaScript.

    This project isn't completed yet, quite a few of the packets are still missing implementations. All of the essential packets (like Ack packets) are implemented as well as other frequently used ones such as text and trade packets.
    The GoundTile data is loaded from xml resources currently, but Objects.xml loading still needs to be added.

    The project is modular, so it supports running plugins (similar to KRelay). The project only has one default plugin so far which is more of an example of how to structure plugins.

    The account information is loaded through a JSON file, and it supports running multiple accounts at once. This is the structure of the accounts file:
     
    Code:
    {
        "buildVersion": "X19.0.1",
        "accounts": [
            {
                "guid": "john@email.com",
                "password": "SecretPassWord11",
                "serverPref": "AsiaSouthEast"
            }
        ]
    }


    The client can be run anywhere from the console with a simple command and will connect to the nexus.
    When it starts it will look something like this:


    Side Note
    I called this project nrelay (Nodejs Relay) before JRelay was released, I don't want there to be 3 different 'letter'-relay programs as that is a bit confusing. It's a lot of work to refactor the name everywhere but will probably happen at some point.
    The name is also a tiny bit misleading as it's not actually a relay, but a client. All implemented packets do have a read/write implementation however, so it could be turned in to a relay with minimal extra code (the code could even be in a plugin).

    If you get the client up and running, it won't do much other than sit in the nexus. The default plugin will respond to you if you whisper the client 'hello', so you can test if the client is working or not.



    And here is an example of running more than one client. These bots will just walk in a circle along the edge of the nexus spawn platform.



    The functionality of these bots walking in a circle around the nexus fountains was actually added by making a plugin. This is the source code for the plugin:
     
    Code:
    import { NrPlugin, HookPacket, Packet, PacketType, Client, Log } from './../core/plugin-module';
    
    import { WorldPosData } from './../networking/data/world-pos-data';
    import { NewTickPacket } from './../networking/packets/incoming/newtick-packet';
    
    const path = [
        { x: 129.5824, y: 143.6437 }, // bottom-left
        { x: 138.5885, y: 143.6437 }, // bottom-right
        { x: 138.5885, y: 136.4980 }, // top-right
        { x: 129.5824, y: 136.4980 }  // top-left
    ];
    
     @NRPlugin({
        name: 'Path Walker',
        author: 'tcrane'
    })
    export default class WalkpathPlugin {
    
        private players: {
            [id: number]: any[]
        };
    
        constructor() {
            this.players = {};
        }
    
        @hookPacket(PacketType.NewTick)
        onNewTick(client: Client, newTickPacket: NewTickPacket): void {
            if (!this.players[client.playerData.objectId]) {
                this.players[client.playerData.objectId] = path.slice();
            }
            if (!client.nextPos) {
                const wp = new WorldPosData();
                const point = this.players[client.playerData.objectId].pop();
                this.players[client.playerData.objectId].unshift(point);
                wp.x = point.x;
                wp.y = point.y;
                client.nextPos = wp;
            }
        }
    }


    This project is hosted on my ****** page where you will also find a readme on how to setup and run the client, as well as a large amount of documentation covering how to write plugins, packet types and data structures available to use when making plugins.

    I thought ****** links were not allowed, but have recently seen other posts using ****** links. Just to be safe I won't link the ****** but please let me know if the rules have changed @Raple @Ahlwong
    The ****** endpoint is '/thomas-crane/nrelay'.

    The TypeScript source is attached to this post, but you will need to build the source yourself to run the client. You can look at the included readme file or the ****** to see how to do this. The only thing you need to have installed before running this client is Nodejs

    There is still a fair bit of functionality that can be added to the client, so feel free to open a pull request or an issue if you find a bug.

    Virus Scans
    Jotti. (0/17)
    Virus Total. (0/51)
    is there away i can add you, on skype or dcord?

  6. #5
    Killer Be Killed's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    212
    Reputation
    53
    Thanks
    2,352
    My Mood
    Asleep
    Quote Originally Posted by SeXZeFPS View Post
    is there away i can add you, on skype or dcord?
    Sure,
    Killer Be Killed#1781

  7. #6
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Approved.

    Also, you're correct about ****** links. I've removed them where possible
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  8. #7
    nith822's Avatar
    Join Date
    Nov 2017
    Gender
    male
    Posts
    1
    Reputation
    10
    Thanks
    1
    Hey this looks amazing! It's really well documented and intuitive, and it's such a godsend for people looking to get into rotmg hacking like myself. I sent you a request on dcord if you would be willing to answer a few questions.

  9. The Following User Says Thank You to nith822 For This Useful Post:

    Killer Be Killed (11-23-2017)

  10. #8
    Killer Be Killed's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    212
    Reputation
    53
    Thanks
    2,352
    My Mood
    Asleep
    Quote Originally Posted by nith822 View Post
    Hey this looks amazing! It's really well documented and intuitive, and it's such a godsend for people looking to get into rotmg hacking like myself. I sent you a request on dcord if you would be willing to answer a few questions.
    Yeah that's fine, although I'm not sure what timezone you're in so I might not be online at the same time.

    X19.1.0 Update
    Since the only thing that has changed is the packet ids, there is not point re-uploading the entire source code.
    To update your packet ids, open the file src/networking/packet.ts, scroll to the bottom, and replace the existing PacketType enum with this:
    Code:
    export enum PacketType {
        Hello = 41,
        MapInfo = 67,
        Load = 97,
        Failure = 0,
        CreateSuccess = 21,
        Update = 5,
        UpdateAck = 62,
        AoeAck = 50,
        ShootAck = 79,
        Goto = 95,
        GotoAck = 19,
        Aoe = 88,
        NewTick = 68,
        Ping = 83,
        Pong = 80,
        Move = 84,
        Text = 26,
        PlayerText = 76,
        Create = 46,
        RequestTrade = 36,
        TradeRequested = 24,
        TradeStart = 17,
        ChangeTrade = 7,
        TradeChanged = 96,
        AcceptTrade = 91,
        CancelTrade = 100,
        TradeDone = 25,
        TradeAccepted = 6,
        ServerPlayerShoot = 90
    }
    EDIT:
    You will need to rebuild the source after you change the packet ids.
    Last edited by Killer Be Killed; 11-23-2017 at 05:10 AM.

  11. #9
    JiiJiiJari's Avatar
    Join Date
    Jan 2018
    Gender
    male
    Location
    Nummela, Vihti, Finland
    Posts
    95
    Reputation
    10
    Thanks
    14
    My Mood
    Cheerful
    The path plugin is not working

  12. #10
    Killer Be Killed's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    212
    Reputation
    53
    Thanks
    2,352
    My Mood
    Asleep
    Quote Originally Posted by JiiJiiJari View Post
    The path plugin is not working
    The version on this post is extremely outdated and no longer working. Please get the latest version from the ******. The path plugin should work with the latest version from ******.

  13. #11
    JiiJiiJari's Avatar
    Join Date
    Jan 2018
    Gender
    male
    Location
    Nummela, Vihti, Finland
    Posts
    95
    Reputation
    10
    Thanks
    14
    My Mood
    Cheerful
    Quote Originally Posted by Killer Be Killed View Post
    The version on this post is extremely outdated and no longer working. Please get the latest version from the ******. The path plugin should work with the latest version from ******.

    The packets are outdated on the Pathwalker. I got help from KoolKash and its working fine now fixed code:


    Code:
    import { NrPlugin, HookPacket, Packet, PacketType, Client, Log } from './../core/plugin-module';
    
    import { WorldPosData } from './../networking/data/world-pos-data';
    import { NewTickPacket } from './../networking/packets/incoming/newtick-packet';
    
    const path = [
        { x: 129.5824, y: 143.6437 }, // bottom-left
        { x: 138.5885, y: 143.6437 }, // bottom-right
        { x: 138.5885, y: 136.4980 }, // top-right
        { x: 129.5824, y: 136.4980 }  // top-left
    ];
    
      @//NrPlugin({
        name: 'Path Walker',
        author: 'tcrane'
    })
    export default class WalkpathPlugin {
    
        private players: {
            [id: number]: any[]
        };
    
        constructor() {
            this.players = {};
        }
    
        @//HookPacket(PacketType.NEWTICK)
        onNEWTICK(client: Client, newTickPacket: NewTickPacket): void {
            if (!this.players[client.playerData.objectId]) {
                this.players[client.playerData.objectId] = path.slice();
            }
            if (!client.nextPos) {
                const wp = new WorldPosData();
                const point = this.players[client.playerData.objectId].pop();
                this.players[client.playerData.objectId].unshift(point);
                wp.x = point.x;
                wp.y = point.y;
                client.nextPos = wp;
            }
        }
    }
    Take off the red // annoying tagging makes the code broken a bit.
    The spots with a bit outdated code are marked green.
    All thanks for the explanation how to fix it goes to Koolkash aka Rotmg Troller
    Last edited by JiiJiiJari; 03-08-2018 at 12:59 PM.

  14. The Following User Says Thank You to JiiJiiJari For This Useful Post:

    DavisXola (03-12-2018)

  15. #12
    Mew's Avatar
    Join Date
    Jun 2012
    Gender
    female
    Location
    On MPGH
    Posts
    759
    Reputation
    102
    Thanks
    3,542
    Quote Originally Posted by Killer Be Killed View Post
    The version on this post is extremely outdated and no longer working. Please get the latest version from the ******. The path plugin should work with the latest version from ******.
    Is this still being updated and maintained? Looks very interesting, and I might be interested in forking to help it out.

  16. #13
    Killer Be Killed's Avatar
    Join Date
    Jun 2010
    Gender
    male
    Posts
    212
    Reputation
    53
    Thanks
    2,352
    My Mood
    Asleep
    Quote Originally Posted by Mew View Post
    Is this still being updated and maintained? Looks very interesting, and I might be interested in forking to help it out.
    Yes, the current version on ****** is updated to X23.0.0 and it is still under active development. The next feature to be added is projectile handling, which is almost done.

  17. #14
    gW$RYHW$YW$YHWHerhRH's Avatar
    Join Date
    Oct 2017
    Gender
    male
    Posts
    158
    Reputation
    10
    Thanks
    52
    Quote Originally Posted by Mew View Post
    Is this still being updated and maintained? Looks very interesting, and I might be interested in forking to help it out.
    Yeh, you wouldn't know it by looking at the number of posts in this thread but nrelay is polished as fuck.

  18. The Following 2 Users Say Thank You to gW$RYHW$YW$YHWHerhRH For This Useful Post:

    Killer Be Killed (03-10-2018),SeXZeFPS (03-10-2018)

  19. #15
    panton123's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    Hey I was wondering if there is a cli command that I can call to force an update?
    I was getting:
    Code:
    [00:31:35 | ResourceManager] Error reading Objects.json
    Deleted Objects.json

    Trying execution again with --debug as well.

    Code:
    sudo nrelay --debug
    [00:32:18 | NRelay]           Starting in debug mode...
    [00:32:18 | NRelay]           Checking for updates...
    [00:32:19 | ResourceManager]  Error reading Objects.json
    [00:32:19 | ResourceManager] Error: ENOENT: no such file or directory, open '/home/pantsu/projects/nrelay/resources/Objects.json'

    I restored the original Objects.json and ran it with --debug.

    Code:
    [00:40:56 | ResourceManager]  Error reading Objects.json
    [00:40:56 | ResourceManager] SyntaxError: Unexpected end of JSON input
    Manually editing the Objects.json files and adding the following to the end of the file.
    Code:
    }
    }
    ]
    }
    Made the launch Error disappear but I still can't get the test hello plugin to work either.
    I still think my Objects.json might be lacking things, it's currently at 193458 lines long and I don't have a proper reference one saved that I can exchange it for or compared sizes to.
    Last edited by panton123; 03-11-2018 at 05:50 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Release] [OPEN SOURCE]The Colony: A 100% Open Source Hacked Client
    By godshawk in forum Minecraft Hacks & Cheats
    Replies: 87
    Last Post: 09-17-2013, 09:29 PM
  2. [Open Source]Docket[TCP Socket DLL] (Client Only)
    By Deto in forum Visual Basic Programming
    Replies: 17
    Last Post: 02-05-2011, 09:02 AM
  3. Combat Arms Utilities Open Source Project
    By User1 in forum Combat Arms Hacks & Cheats
    Replies: 28
    Last Post: 09-20-2009, 02:08 AM
  4. Replies: 0
    Last Post: 09-01-2008, 08:28 PM