Esempio n. 1
0
 /// <summary>
 /// Constructor for a scripted waypoint.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this object.</param>
 /// <param name="loc">A world location.</param>
 /// <param name="code">The C# code that will be loaded as a script.</param>
 public Waypoint(Cavebot parent, Objects.Location loc, string code, string label = "")
 {
     this.Parent        = parent;
     this.Location      = loc;
     this.Script        = new Script(this.Parent, code, this);
     this.Type          = Types.Script;
     this.NodeLocations = new List <Objects.Location>();
     this.Label         = label;
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this object.</param>
 public Targeting(Cavebot parent)
 {
     this.Parent                 = parent;
     this.ResetEvent             = new ManualResetEventSlim();
     this.ResetEventCacheUpdated = new AutoResetEvent(false);
     this.StopwatchExhaust       = new Stopwatch();
     this.CreatureTimestamps     = new Dictionary <uint, long>();
     this.CreatureWatchlist      = new Dictionary <uint, Objects.Location>();
 }
Esempio n. 3
0
 public HModules(Core core)
 {
     Cavebot   = new Cavebot(ref core);
     General   = new General(ref core);
     Heal      = new Heal(ref core);
     Looter    = new Looter(ref core);
     Targeting = new Targeting(ref core);
     Scripter  = new Scripter(ref core);
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor for a target.
 /// </summary>
 /// <param name="parent">The Cavebot module that will hosts this object.</param>
 /// <param name="name">The name of the creature to look for.</param>
 /// <param name="settings">A collection of Target.Setting objects, used as criterias when finding a new target.</param>
 public Target(Cavebot parent, string name, List <Target.Setting> settings)
 {
     this.Parent   = parent;
     this.Name     = name;
     this.Settings = settings;
     this.DoLoot   = true;
     while (this.Settings.Count < this.SettingsMaxCount)
     {
         this.Settings.Add(Target.Setting.GetDefaults(this));
     }
 }
Esempio n. 5
0
            /// <summary>
            /// Constructor for a node waypoint.
            /// </summary>
            /// <param name="parent">The Cavebot module that will host this object.</param>
            /// <param name="loc">A world location.</param>
            /// <param name="nodes">A collection of world locations that will serve as subnodes.</param>
            public Waypoint(Cavebot parent, Objects.Location loc, IEnumerable <Objects.Location> nodes, string label = "")
            {
                this.Parent        = parent;
                this.Location      = loc;
                this.Type          = Types.Node;
                this.NodeLocations = nodes != null?
                                     nodes.ToList <Objects.Location>() :
                                         new List <Objects.Location>();

                this.Script = new Script(this.Parent, string.Empty, this);
                this.Label  = label;
            }
Esempio n. 6
0
        public Main()
        {
            try
            {
                InitializeComponent();

                /// Activate PXG screen
                AutoItX.WinActivate(Addresses.PxgClientName);

                /// Find PXG Handle
                Addresses.RegisterHandle();

                /// This sets all the rectangles of the screens
                UpdateGUI();

                /// Start reading from memory
                MemoryManager.StartMemoryManager(Addresses.PxgPointerAddress, Addresses.PxgProcessName);

                /// Init Pokemon settings
                Pokemon.Init();

                /// This loads all the available monsters to the ListBoxes on settings screen
                LoadAvailableMonsters();

                /// This loads the Player settings in settings.json
                LoadPlayerSettings();

                /// Cavebot placeholder actions
                //Cavebot.TestInit();

                /// This is used populate Cavebot Tree
                UpdateCavebotTree();

                /// Create an "instance" of Cavebot and CavebotAttack and start InputHandler loop
                Task.Run(() => Cavebot.Start());
                Task.Run(() => CavebotAttack.Start());
                Task.Run(() => CavebotAttack.StartSpells());

                this.Location = new Point(GUI.WindowRect.X + 10, GUI.WindowRect.Y + 160);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: Main constructor: " + ex.Message);
            }
        }
Esempio n. 7
0
 /// <summary>
 /// Constructor for an empty target.
 /// </summary>
 /// <param name="parent">The Cavebot module that will hosts this object.</param>
 public Target(Cavebot parent)
     : this(parent, "New monster", new List <Setting>())
 {
 }
Esempio n. 8
0
 /// <summary>
 /// Constructor an empty waypoint.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this object.</param>
 public Waypoint(Cavebot parent, string label = "")
 {
     this.Parent   = parent;
     this.Location = Objects.Location.Invalid;
     this.Label    = label;
 }
Esempio n. 9
0
 public Looter(Cavebot parent)
 {
     this.Parent             = parent;
     this.ResetEvent         = new ManualResetEventSlim();
     this.ResetEventMultiUse = new AutoResetEvent(false);
 }
Esempio n. 10
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this object.</param>
 public Walker(Cavebot parent)
 {
     this.Parent                 = parent;
     this.ResetEvent             = new ManualResetEventSlim();
     this.ResetEventTilesUpdated = new AutoResetEvent(false);
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this script.</param>
 /// <param name="code">The C# code that will be run when this script is executed.</param>
 /// <param name="waypoint">The waypoint to associate with this script.</param>
 public Script(Cavebot parent, string code, Waypoint waypoint)
 {
     this.Parent   = parent;
     this.Code     = code;
     this.Waypoint = waypoint;
 }
Esempio n. 12
0
 /// <summary>
 /// Constructor for this class.
 /// </summary>
 /// <param name="parent">The Cavebot module that will host this script.</param>
 /// <param name="code">The C# code that will be run when this script is executed.</param>
 public Script(Cavebot parent, string code)
     : this(parent, code, null)
 {
 }