[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:
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:
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.
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:
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:
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.
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
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.
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:
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 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:
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.
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.
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.
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.