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

[Feature Request] DiaActivePlayer.Events

xsol

Member
Joined
Nov 7, 2011
Messages
503
Reaction score
12
These events would be useful:

Code:
public class DiaActivePlayer : DiaPlayer
{
    public event EventHandler UsedWaypoint;
    public event EventHandler UsedPortal;
    public event EventHandler ChangedWorld;
    public event EventHandler UsedObject;
    public event EventHandler TalkedTo;
}

I don't know if those "listeners" would be possible, but I am working on a follow the leader and this event info would be great to enable the leader to notify the followers of where to go. I know profile tags could cause an event no problem, but I don't know if when using CombatBot for example if the bot could/would fire these events if they existed.

Also, functionality to join games by an id/tag/name is really something that is needed.

I'm mainly interested in this to enable advanced development for: http://www.thebuddyforum.com/demonb...gin-mybuddy-local-k-follow-me.html#post586781
 
Last edited:
Code:
            ACD b = null;
            try
            {
                b = (ACD)ZetaDia.Actors.ACDList.First(isBanner => ((ACD)isBanner).Name.Contains("Banner_Player_1"));                
            }
            catch (Exception ex)
            {
                Logging.Write("Find banner error: " + ex.Message);
            }

            if (null != b)
            {
                try
                {
                    Logging.Write("use power");
                    //need parameter info on powerType, is there an enum?
                    ZetaDia.Me.UsePower(
                          SNOPower.Interact_Normal /* every thing that said interact, portal, Enter, Walk, etc */, 
                          b.Position, 
                          ZetaDia.Me.WorldDynamicId, 
                          2, 
                          b.ACDGuid);
                    System.Threading.Thread.Sleep(4000);
                }
                catch (Exception ex)
                {
                    Logging.Write("Use banner error: " + ex.Message);
                }
            }

I can't seem to find a use power that will take the banner, how *should* I click the banner?

The idea is if the other player is > n meters away UseTownPortal() -> TakeFirstPlayerBanner() -> FollowThePlayer()

This would make everything very simple if the player changes zones very quickly the bot should simply tp -> banner to catch up and there is no need to track anything about where the player went or what portal they took, but I've used lots of powers on it and nothing is working; some stuff dcs ;0

RESOLVED
Code:
if(ZetaDia.Me.IsInTown)
                        {
                            Logging.Write("Searching for banner.");
                            ie = ZetaDia.Actors.ACDList.GetEnumerator();
                            while (ie.MoveNext())
                            {
                                if (null != ie.Current)
                                {
                                    ACD acd = (ACD)ie.Current;

                                    if (acd.Name.Contains("Banner") && acd.ActorType == Zeta.Internals.SNO.ActorType.Gizmo)
                                    {
                                        int ri = r.Next(5, 8);

                                        Logging.Write("Found a banner.");

                                        //move
                                        ZetaDia.Me.UsePower(SNOPower.Walk, acd.Position - new Vector3(2, 2, 0), ZetaDia.Me.WorldDynamicId, -1);

                                        //wait
                                        BotMain.PauseFor(System.TimeSpan.FromSeconds(ri)); 
                                        System.Threading.Thread.Sleep(r.Next(ri*1000));

                                        //interact
                                        ZetaDia.Me.UsePower(SNOPower.Axe_Operate_Gizmo, acd.Position, ZetaDia.Me.WorldDynamicId, acd.ACDGuid);

                                        //wait
                                        ri = r.Next(2, 3);
                                        BotMain.PauseFor(System.TimeSpan.FromSeconds(ri));
                                        System.Threading.Thread.Sleep(r.Next(ri * 1000));

                                        //try again?
                                        if (!ZetaDia.Me.IsInTown) break; //basically we want to loop all banners until we skip ours and find a good one
                                        //need a way to test if the damn banner is visible
                                    }
                                }
                            }
                            ie = null;
                        }

T
 
Last edited:
Next problem, detecting which banners are invisible and which banner is your banner.
 
Next problem, detecting which banners are invisible and which banner is your banner.

Hey I am interested in learning more about this exact problem. Are there other threads that talk about how to find this type of information ?
 
Back
Top