What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

A few general questions about API and basic support request. (Also 2 totem build)

leroy1978

New Member
Joined
Mar 5, 2014
Messages
30
Reaction score
0
Hello,

I've been using the bot with some AOE spells and I decided to go for 2 Flame Totem build and I spent everything on respecing my passive skill points. And as I suspected the bot did not work 'well' with this totem build. I also tried ApocsRangerRoutine and TotemLogic v0.0.1. The Apoc's worked but did not perform well, other one didn't work. So I decided to tinker with the API.

At first I tried to make the player dodge damage by running around but I failed. I than tried to make the player run to one of the Totems and I failed again. (Edit: Kinda did this part, look at post #3)

I understand the general structure of the code but I can't get my head around a few things. For example if I want the player to stand still while there are enemies around, where should I do that? And how?

How would I do something like "if player takes damage [....]". How would I know player is taking damage without saving health and checking regularly if it is going down?

I know it is a lot to ask but can I get an overall description/tutorial on using the API? You all know it would make a nice sticky post :p.

I have some programming experience, I made some games using Corona SDK, I'm okay with Java, but this is too much for me to understand without help. But I'm sure I'd be coming up with beautiful stuff once I have a mentor of some sort.

Also, the people who develop plugins and routines: ARE YOU HUMAN? How can someone understand and extend these codes with just looking at them. You make me feel so ignorant!!! :D

Any help is appreciated, please help me get my engine running! Thanks a lot in advance.
 
Okay this works;

Code:
Log.Info(SpellManager.GetSpell("Flame Totem").DeployedObjects.FirstOrDefault().Position);

You see? I'm learning! :D
 
Wow! After about ~8 hours of trial and error I've managed to do this. I wanted my char to run to totems if he was being attacked or if a mob was chasing him. I couldn't do "if damaged" part but here it is;

I created a new Composite;


public Composite CreateMovementLogic2()
{
return new PrioritySelector(


new Decorator(ret => NumberOfMobsNear(LokiPoe.ObjectManager.Me, 40, 1),
new Action(ret =>
{
if(SpellManager.GetSpell("Flame Totem").DeployedObjects.Count() > 0){

Navigator.MoveTo(SpellManager.GetSpell("Flame Totem").DeployedObjects.FirstOrDefault().Position, "_--c--> Hugging Firetotem");

} else if (BestTarget != null){

Navigator.MoveTo(BestTarget.Position, "_--c--> Hugging BestTarget.Position");

} else {

Navigator.MoveTo(LokiPoe.ObjectManager.Me.Position, "_--c--> Hugging Me.Position");

}

})
)


);
}


What this supposed to do is if a mob is near, it moves the player to one of the totems. If there are no totems it moves the player to the position of the best target. If no best target, just stops.

Than I added this with;

Code:
           CombatComposite.AddChild(CreateMovementLogic2());


To the last line of the region: #region Overrides of CombatRoutine in default Exile.cs

I'd be happy if one of the experienced devs looked at my code and advised me. And I still can't understand where to put the function calls if, say, I want something to happen every 30 seconds. Or, say, if I want some function to trigger based on a custom event. Like:

Do this if total number of mobs around is 30,
Do that if health is < %20,
Do this if taking damage,
etc.


This is both fun and frustrating. I'm in need of help :p
 
Turns out it wasn't working at all :/ It only moves to totem for fraction of a second, and than the default mover takes back control. Ah how I wish I was more capable at coding.. :(
 
Turns out it wasn't working at all :/ It only moves to totem for fraction of a second, and than the default mover takes back control. Ah how I wish I was more capable at coding.. :(

I suggest you examine the TotemLogic v0.0.1 for some example functions :)
Or, eventually, I'll update the CR in the near future - its just not priority atm. Party bot is almost ready though!


This for example is the extracted movementlogic, which dopes LoS checks and then hugs its ShockwaveTotem, if one is placed!
Code:
        public static Composite CreateMovementLogic()
        {
            return new PrioritySelector(
                new Decorator(ret => !Utilities.LoSCheck(MOI),
                    new PrioritySelector(
                        new Decorator(ret => Timer.LoS.ElapsedMilliseconds < 2000 && !Timer.LoS.IsRunning,
                            new Action(ret =>
                            {
                                Timer.LoS.Start();
                            })
                            ),
                        new Decorator(ret => Timer.LoS.ElapsedMilliseconds > 2000,
                            new Action(ret =>
                            {
                                CommonBehaviors.MoveTo(on => MOI.Position, reason => "Target not in Line of Sight for 2 seconds... Facetanking. H?AAA!");
                                Timer.LoS.Reset();
                            })
                            )
                        )
                    ),

                new Decorator(ret => Timer.MoveToShockwaveTotem.ElapsedMilliseconds < 4000 && !Timer.MoveToShockwaveTotem.IsRunning,
                    new Action(ret =>
                        {
                            Timer.MoveToShockwaveTotem.Start();
                        })
                    ),
                new Decorator(ret => Timer.MoveToShockwaveTotem.ElapsedMilliseconds > 4000,
                    new Action(ret =>
                        {
                            CommonBehaviors.MoveTo(on => Spellbook.ShockwaveTotem.DeployedObjects.FirstOrDefault().Position, reason => "Lets hug a totem!");
                            Timer.MoveToShockwaveTotem.Reset();
                        })
                    )

                );
        }

"Problem" is, theres a lot of internal functions / variables used that do not ship with the bot, so you (or me) gotta dig into that (again).

if you have questions, you can always add me on skype :)
other than that, from what i've seen of your code it heads in the right direction! ALso, assuming you started coding based of the Exile.cs i advise you not to, cause its pretty "messy" and has a lot, really a lot, of stuff not really needed or rational.

regards
 
Back
Top