Author Topic: [C# .NET, ScriptSDK, Bot] Combot (RC2) - responsive multi-botting  (Read 15772 times)

0 Members and 1 Guest are viewing this topic.

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Combot (RC2) - release candidate v2

What?
Combot is a system for handling multiple concurrent Stealth profiles capable of communicating with each-other.

Why?
If you have a script that checks for information from UO and does something based on that information....  then you take that script and you multiply it by how many profiles you're running it on.  If the profiles could share information with each other, they would not all need to request information from Stealth.  This makes it more efficient by having the scripts share information with between profiles.  Combot is also capable of client cross-communication.

Examples of usage:
You have a group of profiles existing in the same space (shard, screen) and they are fighting some monster together.  If you're running the same script through Stealth for each profile to check one another's health and heal them when they need it, then all your profiles will always try and heal the same person at the same time.  If another profile was damaged, it wouldn't get a heal until all the profiles finished healing someone else.    Combot's job priority system can be used to delegate tasks, such as healing, to each profile that it's connected to.  Instead of all the profiles trying to heal the same person, the Combot hub (server) will assign each profile with a different healing job.

How?
Combot makes it so only one profile is requesting data from Stealth while the other profiles feed off that data over TCP/IP.  This system is broken down into three parts (two of which are only important) - Client, Server, Data.  First you run the Server on the profile that you want to act as the "hub" for all other bots.  This will collect any data from Stealth that all the other bots need - such as checking player health.  That runs in something called a "Routine" which I'll talk more about later.  The Server Routine collects data and issues Jobs to the JobQueue based on that criteria.  When a new Job is added on the Server, it will notify each Client that is connected - this can also be setup to only notify certain Clients based on criteria (like if it's a bandage job, don't notify clients who don't have healing.)  As the server starts notifying Clients, if a Client is not busy with another Job it will accept it and notify the Server that the Job is now assigned so that Clients aren't don't pick up the same Job.  Once the Client is finished with the Job, it notifies the Server that the Job is complete and the Server removes the Job from the JobQueue.  You can run the Client on as many Stealth profiles as you desire.

Structure:
I'm going to have to write up a lot more documentation on this, but I'm going to give you guys all the need-to-knows now.

Routines - Both the Client and the Server have Routines.

The Server Routine contains the checks to Stealth that you want to also share with the Clients.  It also assigns jobs to the JobQueue based on the checks that you have done in the Server Routine.

The Client Routine contains what you want the client to do on its own - like making sure you're staying within range of the Leader (the Server.)  You can add your own routines; right now both the Client and the Server have example routines named "Combat."  The Client also has a routine named Job - this defines how Jobs should be handled on the Client-side.  For example, the Server sends a Client a Job to bandage someone, the Client runs the JobHandler in the Job Routine to check what type of job it is, and calls a method in the Routine to handle the Job.



Status:
This project is 85% complete.  I'm up to coding the response to the server when a client accepts a job, so I have to finish that and then setup methods for the server to queue the job on completion.  I'm throwing this somewhat incomplete project up here for example, but I am still working on it and it will be complete very soon.


Files:
NEW LINKS COMING SOON

If you want to get this setup and running in it's current state, download the entire solution and open it up in Visual Studio 2013 (free community edition can be downloaded.)

Server\Routine\Combat.cs
You'll see there's a GroupList - this is a list containing all the player IDs whom are to be checked (for health.)  Add/Remove as many as you like and remember to change the number to whatever ID your character is.

Client\Client.cs
Line 68 - set this to your machines local network IP.

Start up Stealth and connect with a profile that you want to act as a hub.  Compile and start the Server.  Use Stealth to connect another profile that you want to act as a client.  Compile and start the client.

This post is also a work in progress.

Updates:
4/21/15 - Job system complete overhaul.
4/22/15 - Job system tweaked.
4/29/15 - Job rejection added, major updates.  RC1 released
10/28/15 - RC2 - ScriptSDK
« Last Edit: October 28, 2015, 04:26:11 AM by unisharp »

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [C#, Bot] Combot - responsive multi-botting (pre-alpha)
« Reply #1 on: April 17, 2015, 06:19:56 AM »
0
Documentation:

Coming soon...



Video Guide:

Coming soon...
« Last Edit: July 10, 2015, 10:59:49 AM by unisharp »

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [C#, Bot] Combot - responsive multi-botting (pre-alpha)
« Reply #2 on: April 17, 2015, 08:21:22 AM »
0
Thank you for your awesome contribution!

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [C#, Bot] Combot - responsive multi-botting (pre-alpha)
« Reply #3 on: April 22, 2015, 03:08:57 PM »
0
Thanks :)  Wouldn't be possible without Stealth!

The job system is 99% complete.  There's one thing missing and that's how to handle rejected jobs.  A rejected job comes from the client when they could not complete the job they were given.  An example of a rejected job would be when a client can't bandage someone because they were already full health or too far away, or when a client fizzles on casting Close Wounds.

So here's the dilemma.  If a client fizzles Close Wounds, should the client request the target's health again before re-casting Close Wounds, creating extra work for Stealth to do?  Should the client just tell the server he fizzled, and if so should the server assign the job to someone else.

Right now, rejected jobs are just ignored or not handled because I'm currently undecided on how to handle this.

EDIT: There will be Videos posted soon: Getting Started, Creating New Jobs, Creating New Routines
« Last Edit: July 10, 2015, 10:59:57 AM by unisharp »

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [C#, Bot] Combot - responsive multi-botting (pre-alpha)
« Reply #4 on: April 22, 2015, 11:34:31 PM »
0

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [C#, Bot] Combot - responsive multi-botting (pre-alpha)
« Reply #5 on: April 29, 2015, 07:46:51 AM »
0
OK I'm too a point where I think I can call this a release candidate, but not 100% stable yet.
 
Added job rejection:
Jobs now have a new property - a list of clients who rejected the job.  When the server receives a job rejection packet, the client is added to the Rejectors property of the Job object.  **The server then calls a notify.  The Queue notify function has been updated, it now checks if a job has any rejectors and if so, doesn't notify them again.  If all clients connected to the server reject the job, the list of rejectors is reset and the job goes back into the queue.

Clients can add jobs now too:
I have a poison check in my server routine, but I couldn't pass on having the clients add themselves when they get a buff/debuff event.  So not only does the server check for poisoned characters, but clients will be adding themselves if they are poisoned.

Thread locking and Added Exception Catching for the Job Queue:
There are circumstances when the server will be notifying clients about jobs, and a job will be completed in that process.  This will cause an Exception and usually cause the program to crash.  We now catch the exceptions so the program can continue doing it's job.  I added thread locking to all the functions that deal with modifying the jobqueue in hopes that this wouldn't happen again, but it still did.  So I ended up removing the locks for now, may end up putting them back once I find a solution.  The locker object still exists under the queue class, it's just not used.

Jobs moved to Server.Data:
I had to move the Job class into the data section because I wanted to serialize a job and send it through a packet and just moving the class was less work.

Exception Catching:
Added try/catches almost everywhere.

WTF!?!  COLORS IN MY CONSOLE!
I added a function to handle writing to the console in colors.  Combot.consoleMessage()


I'm close to making that video to go over all this... stuff :)

EDIT: I casted Explo/FS/Poison on 1 character with 3 clients connected.  One client cast cleanse, one client cast close wounds, the other used a bandage - and they figured it out allll by themselves  Pretty sweet ;)

**EDIT2: Took out the call to notify from the rejection procedure.  In one second the server cycled a rejected job through 3 clients 12 times!  What I mean is, Clients: A, B and C each rejected the same job consecutively, 4 times each, in one second lol...  I had to put a stop to this because it was ending in a semi-endless loop to which the job would just keep getting cycled until someone picked it up.  So I changed it to when all the clients have rejected the job, the job is removed from the Queue...  if it needs to be done again the server will issue it from the server routine.
« Last Edit: July 10, 2015, 11:00:12 AM by unisharp »

Offline Crome969

  • Moderator
  • *
  • *****
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: [C# .NET, Bot] Combot (RC1) - responsive multi-botting
« Reply #6 on: April 30, 2015, 12:24:34 AM »
0
In my Eyes a very important Release, showing another great potencial of Stealth.

*Sticky-Mode*

Offline unisharpTopic starter

  • Elite
  • ***
  • *
  • Posts: 196
  • Activity:
    0%
  • Reputation Power: 4
  • unisharp has no influence.
  • Gender: Male
  • Respect: +40
  • Referrals: 0
    • View Profile
Re: [C# .NET, Bot] Combot (RC2) - responsive multi-botting
« Reply #7 on: October 28, 2015, 04:25:49 AM »
0
RC2:

Redone for ScriptSDK, more changes coming soon...

Tags: