Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - unisharp

Pages: 1 ... 9 10 [11] 12 13 14
151
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

152
Documentation:

Coming soon...



Video Guide:

Coming soon...

153
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

154
Stealth archive / Re: c# help - handling multiple stealth profiles?
« on: April 04, 2015, 11:35:11 AM »
I would love to see some of your code, never was a fan of threads but would like to learn by it ;)

I'll be posting some soon after I get a chance to clean it up a little :)

I keep designing windows forms and then change my mind and not use them lol

155
Stealth archive / Re: c# help - handling multiple stealth profiles?
« on: April 04, 2015, 04:14:21 AM »
I changed around what I'm doing.  First instance of the application will act as a server, each subsequent application will act as a client and connect to the bot server.

This will be a huge performance gain for me.  Now instead of 5 bots running health checks, only 1 will health check (the server) and then delegate healing/dispel/bandaging tasks to rest of the bots (the clients.)

156
Stealth archive / Re: Journal Functions (Performance)
« on: April 03, 2015, 07:48:14 AM »
i had days where i ranned up to 30 accounts on up to 15 different shards..



LOL I'm gona have to do a lot more optimizing to get to that!

157
Stealth archive / Re: Journal Functions (Performance)
« on: April 02, 2015, 02:00:57 PM »
I switched to using the BuffDebuff system, there's a couple things I ran into.

#1 the .IsEnabled is always off

When I use a bandage on someone, these are the BuffDebuff events:

-bandage starts
1069 off
1069 off

- bandage finishes
1069 off
1101 off

I'm assuming the 1101 is an indication of when bandaging has finished.  I used that to determine if bandaging is true or false.

#2 Tested with 1 bot and it worked fine.  Tested with 3 bots and I get an issue, sometimes it won't catch the 1101.  Why do you think when 3 bots are running that the 1101 event doesn't catch sometimes?  Am I flooding with requests?

What I did for now was make a date time check and if bandaging has been true for over 8 seconds (maximum bandage time) then it'll turn false.

What's the most profiles you guys have ran simultaneously (while using scripts on each profile)?

158
Stealth archive / Journal Functions (Performance)
« on: April 02, 2015, 06:43:26 AM »
So I'm analyzing reports on my application and I'm using an average process time of 3.6% which really ain't bad at all, but I'm going to be running multiple applications so I want to optimize as much as possible.

What does my bandage function do?  It's started in a new thread, once it's called it'll bandage the person then wait for completion.  When it completes it sets a boolean to false and the thread exits.  Next time a bandage check is made it checks the boolean before running the bandage function.

Here's the function I'm analyzing...

Code: [Select]
static void bandage(Creature HealTarget)
{
if (HealTarget.Distance < 2 && bandages != null)
{
bandaging = true;
bandages.Use();
Stealth.Default.WaitTargetObject(HealTarget.ID);
response("using bandage on " + HealTarget.Name + ".");
Stealth.Default.WaitJournalLine(DateTime.Now, "You finish applying the bandages|You apply the bandages, but they barely help|You heal what little damage your patient had|You did not stay close enough to heal your patient|That is too far away", 15000);
}
bandaging = false;
}



Digging into -> Combot.Routine.Main

Over half the processing time used in the main routine is checking for health, which is understandable.

Digging into ->Combat.Heal.checkHealth

There's only one called function in this path and it's Bandage.  We can see that WaitJournalLine is using up the most processing time in this function which is also understandable.  Digging into WaitJournalLine, I can see that it's using InJournalBetweenTimes.

Just looking for some suggestions from you guys, I don't have much experience with ScriptDotNet2.dll and documentation is outdated.  Wasn't sure if anyone knew of a better way to do this :)  Basically 30% of the application processing time is spent checking the Journal and I'd like to reduce that.

Thanks!

159
Stealth archive / Re: Auto-Follow Target?
« on: March 31, 2015, 04:22:38 AM »
Odd I must have been trying a different function earlier, MoveXY is indeed better

161
Stealth archive / Auto-Follow Target?
« on: March 30, 2015, 08:01:14 AM »
Is there a way to set a target to Auto-Follow (like if you Alt+Left Click someone)

162
Stealth archive / Re: Stealth Client for Linux?
« on: March 30, 2015, 04:42:04 AM »
orrrr you can pay $1/mo and get a Linux VPS :)

163
Stealth archive / Re: Corpse Looting Help
« on: March 28, 2015, 02:02:23 PM »
Codemap: http://blogs.msdn.com/b/mvpawardprogram/archive/2013/11/08/code-maps-in-visual-studio-2013.aspx

When using Visual Studio, right click your project in the solution explorer and click "Show on Code Map"

164
Stealth archive / Re: Corpse Looting Help
« on: March 28, 2015, 12:00:30 PM »
I'm making a friend (cause I have none *sad face*) to follow me around and do combat with me, heal me, loot, etc.  and he'll be modular so anyone can add their own routine.  Eventually planning on making an app to handle multiple "friends," a web app to check on routine status and/or invoke routine methods (switching tasks) and possibly a mobile app (for fun.)

The code/structure of this program is pretty messy at the moment as I wanted to just see how far I could get with what was available to me.  So far I'm really happy :)  Will probably go back and re-structure my code when I'm done.

There are such monsters that exist in UO (official) that will drop more loot depending on how many people get looting rights.  I'm simply trying to get as many "friends" as possible to get loot rights.

I was contemplating on PVP routines but I really don't think that's what UO needs right now lol.  My buddy did challenge me to make a "friend" that could beat him in a mage duel.  Challenge was accepted.

EDIT: Also, each routine is ran in a separate thread (so my friend can heal me and evaluate loot at the same time.)  I'm planning on adding a job scheduler when I have multiple friends so that they can request jobs and not overlap each other.

165
Stealth archive / Re: Corpse Looting Help
« on: March 28, 2015, 11:58:09 AM »
I was unable to add Script.dll as a reference in Vistual Studio, not sure if I'm using it correctly?

Everything was done using ScriptDotNet2.dll and some helpers from ScriptAPI.cs

To give you an idea of where I'm at and what I'm doing, this is what my program looks like on Code Map (so far):



EDIT: So far everything works (except where I'm up to with looting) and it's REALLY fast, actually, I had to slow it down cause the speed at which it was running routines was just not needed.  That's a good thing though cause when it does stuff like evaluating loot it'll pretty much be instant (I'm expecting.)

Pages: 1 ... 9 10 [11] 12 13 14