Exemplo n.º 1
0
        public static void StashItems()
        {
            UIElement stashUI = null;

            while (stashUI == null || !stashUI.Visible)
            {
                stashUI =
                    Sherpa.GetData(
                        () =>
                        UIElement.Get().Where(
                            x => x.Name.Contains("Root.NormalLayer.stash_dialog_mainPage.panel")).
                        FirstOrDefault());
            }


            foreach (
                var item in
                Sherpa.GetData(() => Me.GetContainerItems(Container.Inventory)).Where(CheckItemStash))
            {
                var i = item;
// ReSharper disable ConvertClosureToMethodGroup
                var p = i.GetItemFreeSpace(Container.Stash);
                if (p.X == -1 || p.Y == -1)
                {
                    continue;
                }
                Sherpa.PerformAction(() => i.MoveItem(Container.Stash, p.X, p.Y));
// ReSharper restore ConvertClosureToMethodGroup
                Thread.Sleep(Game.Ping * 2);
            }
        }
Exemplo n.º 2
0
        public static void SnagItems()
        {
            var items =
                Sherpa.GetData(
                    () =>
                    Unit.Get().Where(
                        x => x.Type == UnitType.Item && x.ItemContainer == Container.Unknown && CheckItemSnag(x)).
                    ToArray());

            while (items.Any())
            {
                var items1 = items;
                Sherpa.PerformAction(
                    () =>
                    Me.UsePower(
                        items1[0].Type == UnitType.Gizmo || items1[0].Type == UnitType.Item
                            ? SNOPowerId.Axe_Operate_Gizmo
                            : SNOPowerId.Axe_Operate_NPC, items1[0]));
                Thread.Sleep(250);
                items =
                    Sherpa.GetData(
                        () =>
                        Unit.Get().Where(
                            x => x.Type == UnitType.Item && x.ItemContainer == Container.Unknown && CheckItemSnag(x)).
                        ToArray());
            }
        }
Exemplo n.º 3
0
        public static void SalvageItems()
        {
            UIElement salvgUI = null;

            while (salvgUI == null || !salvgUI.Visible)
            {
                salvgUI =
                    Sherpa.GetData(
                        () =>
                        UIElement.Get().Where(
                            x => x.Name.Contains("Root.NormalLayer.vendor_dialog_mainPage.salvage_dialog")).
                        FirstOrDefault());
            }


            var items = Sherpa.GetData(() => Me.GetContainerItems(Container.Inventory).Where(CheckItemSalvage).ToArray());

            Snowshoes.Print(string.Format("Salvaging {0} items", items.Count()));
            foreach (var i in items)
            {
                Unit i1 = i;
                Sherpa.GetBool(i1.SalvageItem);
                Thread.Sleep(Game.Ping);
            }
        }
Exemplo n.º 4
0
        private void DumpAllUnitsToolStripMenuItemClick(object sender, EventArgs e)
        {
            var units = Sherpa.GetData(D3.Unit.Get);

            foreach (var unit in units)
            {
                PrintLine(String.Format("Unit: {0}", unit.Name));
            }
        }
Exemplo n.º 5
0
        public static void SellItems()
        {
            var items = Sherpa.GetData(() => Me.GetContainerItems(Container.Inventory).Where(CheckItemSell).ToArray());

            Snowshoes.Print(string.Format("Selling {0} items", items.Count()));
            foreach (var i in items)
            {
                Unit i1 = i;
                Sherpa.PerformAction(i1.SellItem);
                Thread.Sleep(Game.Ping);
            }
        }
Exemplo n.º 6
0
        public static void IdentifyAll()
        {
            Sherpa.PerformAction(() => UIElement.Get(0xDAECD77F9F0DCFB).Click());
            // open your inventory - necessary for identify

            Thread.Sleep(Game.Ping * 2); // eh. just in case.

            var inventory = Sherpa.GetData(() => Me.GetContainerItems(Container.Inventory));

            foreach (var item in inventory.Where(item => !item.ItemIdentified))
            {
                var item1 = item;
                Sherpa.PerformAction(() => item1.UseItem());
                Sherpa.WaitFor(() => item1.ItemIdentified);
            }
        }
Exemplo n.º 7
0
 public static bool SprintEverywhere(float x, float y)
 {
     if (Me.PrimaryResource < 20)
     {
         Warcry.Use();
     }
     while (Sherpa.GetDistance(x, y) > 10)
     {
         if (Sherpa.GetDistance(x, y) > 30 && Sprint.IsAvailableNow() && Sherpa.GetData(() => Me.PrimaryResource) >= 20)
         {
             Sprint.Use();
             Thread.Sleep(350);
         }
         else
         {
             Sherpa.Walk(x, y);
         }
     }
     return(true);
 }
Exemplo n.º 8
0
 public static bool MoveSuperFuckingFast(float x, float y)
 {
     while (Sherpa.GetDistance(x, y) > 10)
     {
         if (Sherpa.GetDistance(x, y) > 50 && Vault.IsAvailableNow() && Sherpa.GetData(() => Me.SecondaryResource) > 22)
         {
             Vault.Use(x, y);
             Thread.Sleep(350);
         }
         else if (Sherpa.GetDistance(x, y) > 30 && SmokeScreen.IsAvailableNow())
         {
             SmokeScreen.Use();
             Sherpa.Walk(x, y);
         }
         else
         {
             Sherpa.Walk(x, y);
         }
     }
     return(true);
 }