Code Monkey home page Code Monkey logo

famebot's Introduction

FameBot

A bot for Realm of the Mad God designed to automate the process of collecting fame. This bot works by finding clusters of players on the map and following them. The bot moves the player using a WINAPI method which simulates keypresses, so it will still work when the game window is minimized. The bot has customizable settings which allow the user to change the behaviour of the bot as well as the settings of the clustering algorithm.

For more info read the FAQ, or have a look at the project's Wiki.

Updates

As of version 1.0.69 there is now the ability to force the bot to choose a specific realm instead of the fullest realm. This can be done using the command /famebot prefer <realmname> where <realmname> is the name of the realm you want the bot to choose. E.g. /famebot prefer beholder. The case of <realmname> doesn't matter, so Beholder will have the same effect as BeHoLdEr. If the bot cannot find the preferred realm, it will go back to choosing the fullest realm.

Note: If the preferred realm is not loaded when the bot chooses a realm it will clear the preferred realm. To make sure all realms are loaded before the bot chooses one, you should edit your famebot_config.xml so that the realm position is further towards the center of the realm portal area. This is a good position to use:

<RealmLocation>
    <X>107</X>
    <Y>134</Y>
</RealmLocation>

As of version 1.0.63 there is now the ability to change the fountains/realm positions which the bot will go to. This feature can be used anytime the nexus changes to avoid needing to download a new version of the bot. You can read about these new commands, and all other commands for the bot on this Wiki page.

Installation

This is a plugin for KRelay. Make sure you have the latest version of KRelay installed and an swf client which can connect to the proxy server.

Here is a video demonstrating the installation and some footage of the bot in action.

There are 2 options available to get this plugin.

Option 1 (easiest)

  1. Download the repo and open the 'Release' folder

  2. Copy FameBot.dll

  3. Paste it in (or move it to) the Plugins folder of your KRelay.

  4. Start using the FameBot.

Option 2

  1. Clone this repo to a folder somewhere on your computer.

  2. Open FameBot.sln using Visual Studio 2015.

  3. Right click on the FameBot project and select build.

  4. Right click on the Solution and select Open Folder in File Explorer.

  5. Open the 'Release' folder.

  6. Copy FameBot.dll to the Plugins folder of your KRelay.

  7. Start using the FameBot.

Usage

Make sure the in-game camera angle is set to 0 degrees before using the FameBot.

  1. Open your game and make sure the proxy server is selected.

  2. Open KRelay and check the event log of the FameBot. If you see the message "Automatically bound to client" you can go to step 4.

  3. If there was no "Automatically bound to client" message, go to the nexus and type "/bind".

  4. Start using the bot.

For a more in-depth look at some of the settings and how to use them, look at the wiki page Usage guide.

UI overview

Start Bot

  • Starts the bot.

Stop Bot

  • Stops the bot.

Info > Show health bar

  • Opens a new window which shows the health of the player. Useful for keeping an eye on health while having the game minimised.

Info > Show key presses

  • Opens a new window which shows the keys which are being 'pressed' by the bot.

Settings > Open Config Manager

  • Opens a new window which allows settings to be changed and saved.

Settings overview

Autonexus

  • Self-explanatory. If you want to disable it and use a better one, set it to 0%.

Escape if no targets

  • If the bot is following a cluster of targets, but that cluster disperses and it can't find another it will go back to the nexus. I highly recommend you leave this option enabled.

Teleport distance

  • The max distance in game tiles away from the target the player can be before attempting to teleport.

Follow distance

  • The max distance in game tiles away from the target the player can be before moving towards it. I recommend watching how the bot behaves before tweaking this.

AutoConnect

  • If enabled, when the bot enters the nexus it will immediately try to connect to the fullest realm.

Find clusters near centre

  • If enabled, the bot will prioritise clusters of players which are closer to the center of the map. There is a known bug which causes unusual behaviour when this is disabled. Unless you are just curious, always leave this enabled.

Max distance between points

  • The max distance in game tiles two players can be from each other before they are no longer part of the same cluster.

Minimum players per cluster

  • The minimum players required per cluster for the bot to target them.

Ticks between cluster scans

  • The number of ticks (NewTickPacket) which pass before the bot will evaluate player clusters again. If your CPU isn't very good or KRelay is using a lot of memory with the bot enabled, try turning this up.

Frequently Asked Questions and Common Problems

Read through these questions before creating a new issue to see if there is already a solution to a problem.

The bot doesn't do anything when I press start

Make sure the bot is bound to the flash player. You can do this by typing /bind in game. The GUI will also display the current process which the bot is bound to. If this process is 'flash' or 'Adobe Flash Player' or something similar, it is probably correct.

The bot just spams 'No valid clusters', what do I do?

'No valid clusters' simply means the bot cannot find a suitable cluster of players to follow. Try turning the minimum players per cluster down, or the max distance between points up.

The bot just walks to the top left corner of the nexus

Make sure the camera angle is set to 0 degrees. If the camera is already on 0 degrees it is likely that the nexus has updated and the bot is using old location values. Submit an issue along the lines of 'Nexus positions need updating' for a fast response.

Contributing

Guidlines for contributing:

Read through the wiki page How the software works to get a better understanding of what each piece of code does. When you make a pull request, try to add only one feature in each pull request. If you have two features you want to add, make two pull requests.

Try to make your commits more granular. This means that instead of saying something like:

Commit A: Added enemy avoidance

Say something like:

Commit A: Added math class for enemy avoidance
Commit B: Added enemy detection to Plugin.cs
Commit C: Added list and custom data type to keep track of enemies
Commit D: Finished enemy avoidance feature

famebot's People

Contributors

natiiix avatar thomas-crane avatar zacktaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

famebot's Issues

Not sure if its just my problem . Error message obtained

[Error] An exception was thrown
within ServerPacket
at Dictionary`2.get_Item

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary2.get_Item(TKey key) at Lib_K_Relay.GameData.GameDataMap2.ByID(IDType id)
at FameBot.Core.Plugin.OnUpdate(Client client, Packet p)
at Lib_K_Relay.Proxy.<>c__DisplayClass37_0.b__0()
at Lib_K_Relay.Utilities.PluginUtils.ProtectedInvoke(Action action, String errorProvider, Type filteredException)

might be cause of the new patch not too sure of the reason.

Trying to move to a realm below the realmposition causes incorrect behaviour

To reproduce this,

  • Find a server with a realm close to the bottom of the realm portal area
  • Use /famebot prefer <realmname> to ensure the bot chooses that realm
  • Use /famebot set realmposition in a spot which is above the realm (higher up on the map)
  • Move back to the fountains and start the bot.

The bot will move towards the realm, but as soon as it falls below the realmposition y value it will move back to the realmposition. This is caused because of the bot will only attempt to move towards an actual portal if it is above the realmposition y value.

My current priority is auto loot, so this won't be fixed until auto loot is implemented.

[Request] Some kind of Discord implementation

This would make proper fame botting functional again, as you could use the discord implementation to fetch the messages from the EUN2.1 Discord.

I already made a rough sketch of how this would work before; I could post that if you need it for reference.

If the bot reconnect's to a same dungeon > kicked to char list.

So if you start the bot he walks normal to dungeon and is joining it.
If you go back to Nexus and he walks to same realm again and tries to enter you get kicked to your char list.

Just wanted to mention this here. (Using it with your latest K-Relay release). Edit: i just saw its the reconhandler in k-relay.. i thought it was already fixed by you. But nice you found it anyways :)

Reconnect doesn't work

When i get nexuses instead of my character moving up nexus and going to the realm, my character moves in a diagonal direction to the left and gets stuck on a wall.
Is this just me?

Trying to edit?

I noticed that the famebot was moving back and forth in the train or was avoiding gods, so I changed the code in the plugin.cs folder, but how do I get everything else into the .dll file that is runnable by Krelay? Thanks.

FameBot Not Moving

I recently was trying to get a famebot and I saw yours. It seemed very good and I tried it out, but I couldn't get it to move. I did everything required, /bind, tried changing settings, and more. I looked at the key presses menu and it showed the bot pressing keys, but I wasn't moving.
screen shot 2017-08-06 at 3 28 51 pm
Note: Using Wine on a Mac

Client disconnected

"Client disconnected. Waiting a few seconds before trying to press play..."
This keeps happening when I go afk. When I come back I find my PPE running against the bottom left corner of nexus. Any help to make the client not disconnect?

Nexus positions need updating

once i start the bot it runs on top left if just started instead of going north to the portals, if i move near the portals then hit start it goes in correctly and if i go in then get ported back to nexus it then move stright to the left not top left but only left

Lag

When this plugin is active through KRelay, i get a shit ton of server lag, including alot of errors in KRelay. Got the latest versions of both.

Any ideas?

Conventionnal changes

I just wanted to recommend changing the plugin name to something more conventional like FameBot and change the command from /bind to /fb or /famebot
Feel free to close this since it isnt really an issue
And also good job, I really like it :)

Replace logging system

The current logging system is known to cause crashes.
I think its most likely a cross-threading issue.

[REQUEST] If nexus, reconnect like clients using reconnect

When you hit 'p' it reconnects back to realm for crazyclient. My suggestion would be to have it if you nexus from anywhere besides oryx castle, it automatically reconnects you like the client using its reconnect feature.

It would bypass waiting for the realm to have an open spot again ๐Ÿ’ƒ

Inability to send messages

My idea for a solution: Add a textarea in the famebot window that lets you send messages. Just a suggestion.

[Enhancement] Entering of realms

Allow auto reconnect to realms aft entering realms via /nexustutorial . currently the famebot only allows entering of full realms when directly entered from the portal. since client reconnect to realm works aft using /nextutorial to enter i figured it should be possible to implement in the famebot considering how most of the time if you make it late to the fametrain it close to never opens again within a short period.

Thanks for reading :)

Krelay Issue

Im having an issue with the client.

[Listener] Starting local listener...
[Listener] Local listener started.
[Listener] Stopping local listener...
[Error] An exception was thrown
within LocalConnect
at <>c__DisplayClass31_0.b__0

Object reference not set to an instance of an object.

The krelay cant find my adobe flash projector client and it won;t let me use any plugins such as famebot. Could you help me out? thanks.

Reconnect to realm would reconnect to any realm, despite it not being the optimal one

In commit ebe4481 the added realm reconnect would ignore the optimal realm and reconnect to the realm it was in before either way.

I'm assuming this originates from if (client.State.LastRealm?.Name.Contains(bestName) ?? false)
and would work better if changed to if (client.State.LastRealm?.Name == "NexusPortal." + bestName)
although I haven't tested this fix yet, this should work fine.

Edit: also as seen here: https://azuki.s-ul.eu/s5CCXcsZ I would also set the variable bestName in the else from the first if-statement

Some keystrokes don't get sent to the client when the client windows is focused then loses focus.

The issue can be reproduced by following these steps

  1. Start the bot
  2. Focus the client window (click on the client window)
  3. Focus any other window (click on a window which isn't the client)

When the client window loses focus, some keystrokes don't get sent to the client. E.g. in the nexus, the client can still move sideways (S and D are fine) but cannot move forwards or backwards (W and D are not being sent).

So far this has only been tested in the nexus

[Request] smart autoloot

a autoloot that makes the bot walk to the bag then continue farming would be awesome, i might be wrong but couldn't you make the cluster on the bag and once the pot is picked up the bag is gone so to starts farming

Crashes Often

Often time it just crashes right out of the blue. Most of the times this happens when just farming fame, and not actually trying to escape from escape or something.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.