예제 #1
0
        protected override void Loop()
        {
            StartGame();


            ticks = Environment.TickCount;

            var goldStart = GetData(() => Me.Gold);


            switch (Me.SNOId)
            {
            case SNOActorId.Barbarian_Male:
            case SNOActorId.Barbarian_Female:
                if (!BarbarianCellarRun())
                {
                    return;
                }
                break;

            case SNOActorId.WitchDoctor_Male:
            case SNOActorId.WitchDoctor_Female:
                throw new NotImplementedException();

            //break;
            case SNOActorId.Wizard_Male:
            case SNOActorId.Wizard_Female:
                throw new NotImplementedException();

            //break;
            case SNOActorId.Demonhunter_Male:
            case SNOActorId.Demonhunter_Female:
                if (!DemonHunterCellarRun())
                {
                    return;
                }
                break;

            case SNOActorId.Monk_Male:
            case SNOActorId.Monk_Female:
                throw new NotImplementedException();
                //break;
            }


            SnagIt.SnagItems();


            Snowshoes.Print(string.Format("Collected {0}k!", Math.Round((GetData(() => Me.Gold) - goldStart) / 1000m, 1)));
            var srunTime = Math.Round((Environment.TickCount - ticks) / 1000m, 0);

            _successes.Add(srunTime);
            Snowshoes.Print(String.Format("{0} secs success run ({1} avg); {2}% rate ({3}/{4})", srunTime,
                                          Math.Round(_successes.Average()),
                                          Math.Round((_successes.Count / (_failures.Count + (decimal)_successes.Count)) *
                                                     100m),
                                          _successes.Count, _successes.Count + _failures.Count));
        }
예제 #2
0
        override public void Execute()
        {
            startGame();

            if (Me.LevelArea != SNOLevelArea.A1_trDun_Level07B)
            {
                //throw new Exception("Toon needs to start in 'The Royal Crypts'!");
                return;
            }

            walk(345, 503, true);
            interact("Ornate Door", true);

            // find some skels
            var ironDoor = Unit.Get().FirstOrDefault(x => x.Type == UnitType.Gizmo && x.Name.Contains("Iron Gate") && GetDistance(Me.X, Me.Y, x.X, x.Y) < 100);

            interact(ironDoor, true);

            walk(293f, 500f, true);

            // kill skeletons
            var skels = waitForMobs(30);

            //Game.Print(string.Format("found {0} skels",skels.Length)); //dbg msg

            killAll();

            SnagIt.SnagItems();

            walk(321f, 522f, true);
            walk(345, 496, true);

            interact("Crypt of the Skeleton King", true);

            waitForArea(0x4D4D);
            Thread.Sleep(587);
            SkipSequence();

            walk(316, 427, true);
            walk(284, 430, true);
            walk(250, 428, true);

            waitForMobs(30);
            killAll();

            SnagIt.SnagItems();

            ExitGame();
            //Thread.Sleep(10000);
        }
예제 #3
0
        override public void Execute()
        {
            if (Me.LevelArea != SNOLevelArea.Axe_Bad_Data || (uint)Me.LevelArea != 0x163FD || GetDistance(1991, 2653) > 10)
            {
                if (Game.Ingame)
                {
                    ExitGame();
                    while (Game.Ingame)
                    {
                        Thread.Sleep(383);
                    }
                }
                startGame();
                while (!Game.Ingame)
                {
                    Thread.Sleep(412);
                }
                if ((uint)Me.LevelArea != 0x163FD)
                {
                    Thread.Sleep(5000);
                }
            }

            Thread.Sleep(600);

            repair();

            Thread.Sleep(600);

            walk(1995, 2603, true);
            walk(2025, 2563, true);
            walk(2057, 2528, true);
            walk(2081, 2487, false);
            var cellar = Unit.Get().FirstOrDefault(u => u.ActorId == SNOActorId.g_Portal_Square_Blue && u.Name.Contains("Dank Cellar"));

            if (cellar == default(Unit))
            {
                ExitGame();
                while (Game.Ingame)
                {
                    Thread.Sleep(527);
                }
                return;
            }
            walk(2081, 2487, true);
            walk(2066, 2477, true);

            interact(cellar, true);

            repair(); // first one is too quickly after joining sometimes

            walk(108, 158, true);
            walk(129, 143, true);
            // ranged chars will want to attack from here. Sarkoth will stand still as long as the toon does not enter the room
            walk(120, 109, false);
            killAll();
            SnagIt.SnagItems();
            Thread.Sleep(500);
            killAll(); //?!
            SnagIt.SnagItems();
            ExitGame();
            while (Game.Ingame)
            {
                Thread.Sleep(383);
            }
        }
예제 #4
0
파일: Mira.cs 프로젝트: novaking/rndWalker
        override public void Execute()
        {
            Console.WriteLine("Now Running `MiraBot`");

            // changeQuest(3); works, but is slow
            // 2437D89C: F60E9296FAEC1B2C Root.NormalLayer.BattleNetQuestSelection_main.LayoutRoot.OverlayContainer.QuestMenu.NavigationMenuList._content._stackpanel._item2 (Visible: True)
            // 24383F34: F60E9396FAEC1CDF Root.NormalLayer.BattleNetQuestSelection_main.LayoutRoot.OverlayContainer.QuestMenu.NavigationMenuList._content._stackpanel._item3 (Visible: True)

            while ((uint)Me.QuestId != 0x011A1D || Me.QuestStep != -1)
            {
                changeQuest(2, 0xF60E9296FAEC1B2C);
                Thread.Sleep(1000);
                startGame();
            }

            // ---------------------------------------------------------
            //    long walk....
            // ---------------------------------------------------------
            walk(2965, 2833, true);
            walk(2950, 2800, false);

            interact("Deckard Cain", true);
            walk(2974, 2797, true);
            walk(3003, 2795, true);
            walk(3031, 2771, true);
            walk(3016, 2730, true);
            walk(2974, 2709, true);
            walk(2950, 2666, true);
            walk(2945, 2637, true);
            walk(2940, 2616, false);
            var haedrig = Unit.Get().Where(x => (uint)x.ActorId == 0xFE0C).FirstOrDefault();

            interact(haedrig, true);
            skipConversation();

            // ---------------------------------------------------------
            //    repair at radek
            // ---------------------------------------------------------
            if (needsRepair())
            {
                //  0002B8D8: 00000001(00000000) # {c:ffffffff}Radek the Fence{/c} = 0x1BB715
                var radek = Unit.Get().Where(x => (uint)x.ActorId == 0x0002B8D8).FirstOrDefault();
                interact(radek, true);
                Thread.Sleep(300);
                repairAll();
                Thread.Sleep(100);
                closeInventory();
                //sell?!
            }
            walk(2899, 2591, true);
            walk(2859, 2596, true);
            walk(2827, 2605, true);
            walk(2798, 2619, true);

            // ---------------------------------------------------------
            //    enter the cellar
            // ---------------------------------------------------------
            //var portal = waitForUnit("Cellar of the Damned", 30);
            Thread.Sleep(1000);
            interact("Cellar of the Damned", true);
            waitForArea(0x144A6);
            walk(176, 88, true);
            walk(177, 120, true);
            walk(171, 152, true);

            // ---------------------------------------------------------
            //    destroy the door (replace command below if not melee)
            // ---------------------------------------------------------
            //var door = Unit.Get().Where(x => x.Name.Contains("Sturdy Boarded Door")).ToArray();
            var door = Unit.Get().Where(x => x.ActorId == SNOActorId.trDun_Blacksmith_CellarDoor_Breakable).FirstOrDefault();

            walk(door.X, door.Y, false);
            Thread.Sleep(500);
            Me.UsePower(SNOPowerId.Weapon_Melee_Instant, door);
            //Me.UsePower(SNOPowerId.Weapon_Ranged_Projectile, door);
            Thread.Sleep(600);
            walk(143, 144, false);
            waitForMobs(10);
            killAll();
            if (Me.X > 110)
            {
                walk(110, 148, true);
                killAll();
            }
            walk(70, 145, true);
            killAll();

            // ---------------------------------------------------------
            //    wait for mira
            // ---------------------------------------------------------
            var mira = Unit.Get().Where(x => x.ActorId == SNOActorId.ZombieFemale_A_BlacksmithA).ToArray();

            while (mira.Length <= 0)
            {
                Thread.Sleep(500);
                mira = Unit.Get().Where(x => x.ActorId == SNOActorId.ZombieFemale_A_BlacksmithA).ToArray();
                if (GetDistance(70, 145) > 12)
                {
                    walk(60, 145, true);
                }
            }
            killThese(mira);
            Thread.Sleep(500);
            SnagIt.SnagItems();
            SnagIt.SnagItems();

            // ---------------------------------------------------------
            //    finish quest step and quit game
            // ---------------------------------------------------------
            interact("Haedrig", true);
            skipConversation();
            while (Me.QuestStep != 35)
            {
                Thread.Sleep(500);
            }
            Thread.Sleep(1000);
            ExitGame();
        }