Steps to Join a Public Game:
Check if Game Settings Button is Visible.. if so, click it. (0xC4A9CC94C0A929B)
Check if Game Settings Dialog is Visible. (0x8269F66EFC23F954)
Check the Public Game Button Story Mode is not Visible (0x979726F7C68A6B61) Else Click Adventure Mode (0x317DDE0DFA0395C6)
Check the Public Game Button Adventure Mode is Visible then Click It (0xBCD3AFB4233AFA98)
Check the Join Game Button is Visible then Click It (0xBCD3AFB4233AFA98)
After that you wait until in game or specific time elapsed (not sure how public games work)..
The bracketed text is the UIElement Hash. Using UIElement.FromHash(ID) you can get the objects.
To dump UIElement Hash.. Hover your mouse over the object and hit Alt-8.
Its not to hard of a task.. just a lot of checking..
hook [OutOfGame] is where Demonbuddy creates the next game..
You could easily replace or insert new behaviors into this..
Heres Example Taken From my Project FunkyBot.. which inserts the hook before DemonBuddy can do anything. This is for Mule Stash/Creation behavior I implemented a while back.
Code:
foreach (var hook in TreeHooks.Instance.Hooks)
{
if (hook.Key.Contains("OutOfGame"))
{
PrioritySelector CompositeReplacement = hook.Value[0] as PrioritySelector;
CanRunDecoratorDelegate shouldPreformOutOfGameBehavior = OutOfGame.OutOfGameOverlord;
ActionDelegate actionDelgateOOGBehavior = OutOfGame.OutOfGameBehavior;
Sequence sequenceOOG = new Sequence(
new Action(actionDelgateOOGBehavior)
);
CompositeReplacement.Children.Insert(0, new Decorator(shouldPreformOutOfGameBehavior, sequenceOOG));
hook.Value[0] = CompositeReplacement;
}
}
The CanRunDecoratorDelegate is a static function that returns a bool. (True means proceed with the Behavior!)
The ActionDelegate is a static function that return RunStatus. (Values: Failure ends any future behaviors, Success will continue to next behavior, and Running will loop the behavior).
More information on Treesharp can be found
Here!
You want to hook the behavior only once. I do the hooking during Bot Start Event.
Here is the links to the code for my Mule Behavior. (This was done a while ago.. and I have not looked at it in months..).
https://github.com/herbfunk/Funky/blob/master/FunkyBot/DBHandlers/OOGOverlord.cs
https://github.com/herbfunk/Funky/blob/master/FunkyBot/DBHandlers/CharacterMule/Game.cs