Пример #1
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings = true;
        bot.Options.RestPackets = true;

        bot.Skills.StartTimer();

        bot.Player.LoadBank();
        bot.Inventory.BankAllCoinItems();
        bot.Bank.ToInventory("Astral Ephemerite Essence");
        bot.Bank.ToInventory("Belrot the Fiend Essence");
        bot.Bank.ToInventory("Black Knight Essence");
        bot.Bank.ToInventory("Tiger Leech Essence");
        bot.Bank.ToInventory("Carnax Essence");
        bot.Bank.ToInventory("Chaos Vordred Essence");
        bot.Bank.ToInventory("Dai Tengu Essence");
        bot.Bank.ToInventory("Unending Avatar Essence");
        bot.Bank.ToInventory("Void Dragon Essence");
        bot.Bank.ToInventory("Creature Creation Essence");

        while (!bot.ShouldExit())
        {
            bot.Quests.EnsureAccept(4432);

            bot.Player.Join("timespace");
            bot.Player.HuntForItem("Astral Ephemerite", "Astral Ephemerite Essence", 20);

            bot.Player.Join("citadel");
            bot.Player.HuntForItem("Belrot the Fiend", "Belrot the Fiend Essence", 20);

            bot.Player.Join("greenguardwest");
            bot.Player.HuntForItem("Black Knight", "Black Knight Essence", 20);

            bot.Player.Join("mudluk");
            bot.Player.HuntForItem("Tiger Leech", "Tiger Leech Essence", 20);

            bot.Player.Join("aqlesson");
            bot.Player.HuntForItem("Carnax", "Carnax Essence", 20);

            bot.Player.Join("necrocavern");
            bot.Player.HuntForItem("Chaos Vordred", "Chaos Vordred Essence", 20);

            bot.Player.Join("hachiko");
            bot.Player.HuntForItem("Dai Tengu", "Dai Tengu Essence", 20);

            bot.Player.Join("timevoid");
            bot.Player.HuntForItem("Unending Avatar", "Unending Avatar Essence", 20);

            bot.Player.Join("dragonchallenge");
            bot.Player.HuntForItem("Void Dragon", "Void Dragon Essence", 20);

            bot.Player.Join("maul");
            bot.Player.HuntForItem("Creature Creation", "Creature Creation Essence", 20);

            bot.Quests.EnsureComplete(4432);

            bot.Wait.ForDrop("Void Aura");
            bot.Player.Pickup("Void Aura");
        }
    }
Пример #2
0
 public void DiamondToken(ScriptInterface bot, int q)
 {
     if (bot.Bank.Contains("Diamond Token of Dage"))
     {
         bot.Bank.ToInventory("Diamond Token of Dage");
     }
     if (bot.Bank.Contains("Legion Token"))
     {
         bot.Bank.ToInventory("Legion Token");
     }
     while (bot.Inventory.GetQuantity("Diamond Token of Dage") < 30 &&
            bot.Inventory.GetQuantity("Legion Token") >= 50)
     {
         bot.Quests.EnsureAccept(4743);
         TempItemRoutine(bot, "aqlesson", "Frame9", "Right", "Carnax", "Carnax Eye");
         TempItemRoutine(bot, "dflesson", "r12", "Right", "Fluffy the Dracolich", "Fluffy's Bones");
         TempItemRoutine(bot, "deepchaos", "Frame4", "Left", "Kathool", "Kathool Tentacle");
         TempItemRoutine(bot, "lair", "End", "Right", "Red Dragon", "Red Dragon's Fang");
         TempItemRoutine(bot, "bloodtitan", "Enter", "Spawn", "Blood Titan", "Blood Titan's Blade");
         bot.Player.Join("citadel", "m22", "Left");
         bot.Wait.ForMapLoad("citadel");
         ItemRoutine(bot, "tercessuinotlim-1e9", "Dark Makai", "Defeated Makai", quantity: 25);
         bot.Quests.EnsureComplete(4743);
         bot.Player.Jump("Boss2", "Right");
         bot.Wait.ForCellChange("Boss2");
     }
     bot.Inventory.ToBank("Legion Token");
     bot.Inventory.ToBank("Diamond Token of Dage");
 }
Пример #3
0
    public void DarkToken(ScriptInterface bot, int q)
    {
        string item = "Dark Token";

        if (bot.Bank.Contains(item))
        {
            bot.Bank.ToInventory(item);
        }
        if (bot.Map.Name != "seraphicwardage-1e9")
        {
            bot.Player.Join("seraphicwardage-1e9");
        }
        while (bot.Inventory.GetQuantity(item) < q)
        {
            bot.Quests.EnsureAccept(6249);
            bot.Quests.EnsureAccept(6251);
            while (!bot.Quests.CanComplete(6249) && !bot.Quests.CanComplete(6251))
            {
                bot.Player.Hunt("Seraphic Commander");
            }
            if (bot.Quests.CanComplete(6249))
            {
                bot.Quests.EnsureComplete(6249);
            }
            if (bot.Quests.CanComplete(6251))
            {
                bot.Quests.EnsureComplete(6251);
            }
        }
    }
Пример #4
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Skills.StartTimer();
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.PrivateRooms          = true;
        bot.Options.ExitCombatBeforeQuest = true;

        for (int i = 1; i <= 4; i++)
        {
            bot.Skills.Add(i, 1f);
        }

        int quest = 367;

        string [] item = { "Replacement Tibia", "Phalanges" };
        int  []   q    = { 6, 3 };

        bot.Player.Join("castleundead");

        while (!bot.ShouldExit())
        {
            bot.Quests.EnsureAccept(quest);
            bot.Player.HuntForItems("Skeletal Warrior|Skeletal Viking", item, q, tempItems: true);
            bot.Quests.EnsureComplete(quest);
        }

        bot.Exit();
    }
Пример #5
0
 public void DageEmblem(ScriptInterface bot, int q)
 {
     if (bot.Bank.Contains("Emblem of Dage"))
     {
         return;
     }
     if (bot.Bank.Contains("Legion Seal"))
     {
         bot.Bank.ToInventory("Legion Seal");
     }
     if (!bot.Inventory.Contains("Emblem of Dage"))
     {
         if (bot.Map.Name != "shadowblast")
         {
             bot.Player.Join("shadowblast", "r10", "Left");
         }
         else
         {
             bot.Player.Jump("r10", "Left");
         }
         bot.Quests.EnsureAccept(4742);
         while (!bot.Quests.CanComplete(4742))
         {
             bot.Player.Kill("*");
         }
         bot.Quests.EnsureComplete(4742);
     }
     bot.Inventory.ToBank("Emblem of Dage");
 }
Пример #6
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Skills.StartTimer();
        bot.Options.SafeTimings = true;
        bot.Options.RestPackets = true;

        bot.Inventory.BankAllCoinItems();

        while (!bot.ShouldExit() && !bot.Inventory.Contains("Elemental Ink", 50))
        {
            if (!bot.Inventory.Contains("Mystic Quills", 4))
            {
                bot.Player.Join("mobius", "Slugfit", "Spawn");
                while (!bot.Inventory.Contains("Mystic Quills", 4))
                {
                    bot.Player.Kill("*");
                    bot.Player.Pickup("Mystic Quills");
                    bot.Player.RejectExcept("Mystic Quills");
                }
                bot.Player.Jump("Enter", "Spawn");
            }

            bot.Player.Join("spellcraft");

            bot.SendPacket("%xt%zm%buyItem%671975%13284%549%1637%");
            bot.Sleep(2500);
            bot.SendPacket("%xt%zm%buyItem%671975%13284%549%1637%");
            bot.Sleep(2500);
        }
    }
Пример #7
0
        public int GetNextSkill(ScriptInterface bot)
        {
            int skill = Skills[_index];

            _index++;
            return(skill);
        }
Пример #8
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.ExitCombatBeforeQuest = true;

        bot.Skills.LoadSkills("/Skills/Generic");
        bot.Skills.StartTimer();

        if (bot.Map.Name != "legionarena")
        {
            bot.Player.Join("legionarena", "Boss", "Left");
        }
        bot.Bank.ToInventory("Legion Token");
        while (!bot.ShouldExit())
        {
            bot.Quests.EnsureAccept(6743);
            if (bot.Player.Cell != "Boss")
            {
                bot.Player.Jump("Boss", "Left");
            }
            if (!bot.Quests.CanComplete(6743) && bot.Monsters.Exists("Legion Fiend Rider"))
            {
                bot.Player.Kill("Legion Fiend Rider");
            }
            if (bot.Quests.CanComplete(6743))
            {
                bot.Player.WalkTo(14, 402);
                bot.Quests.EnsureComplete(6743);
            }
            bot.Player.Pickup("Legion Token");
        }
    }
Пример #9
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings   = true;
        bot.Options.RestPackets   = true;
        bot.Options.PrivateRooms  = true;
        bot.Options.InfiniteRange = true;

        bot.Skills.LoadSkills("./Skills/Generic.xml");
        bot.Skills.StartTimer();

        int q = 1070;

        bot.Player.Join("doomundead");

        while (!bot.ShouldExit())
        {
            if (!bot.Quests.IsInProgress(q))
            {
                bot.Quests.EnsureAccept(q);
            }
            bot.Player.HuntForItem("Light Knight", "Light Knight Lifeforce", 5, tempItem: true);
            if (!bot.Inventory.ContainsTempItem("Reached Keep"))
            {
                bot.Player.Jump("Cut2", "Down");
            }
            bot.Wait.ForQuestComplete(q, timeout: 3000);
        }
    }
Пример #10
0
    private void JoinGlitched(ScriptInterface bot, string map, string cell, string pad)
    {
        for (int i = 9; i > 0; i--)
        {
            if (bot.Map.Name != map)
            {
                bot.Player.Join(map + "--999" + i, cell, pad);
            }
            else
            {
                break;
            }
            bot.Sleep(2000);
        }
        bot.Sleep(2000);

        if (bot.Map.Name != map)
        {
            bot.Player.Join(map, cell, pad);
        }
        else if (bot.Map.PlayerCount <= 1)
        {
            bot.Player.Join(map, cell, pad);
        }
    }
Пример #11
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.ExitCombatBeforeQuest = true;

        bot.Skills.StartTimer();

        if (bot.Quests.IsDailyComplete(3596))
        {
            return;
        }

        bot.Player.LoadBank();
        bot.Bank.ToInventory("Dage's Scroll Fragment");

        if (bot.Bank.Contains("Dage's Scroll Fragment", 13))
        {
            return;
        }

        bot.Player.Join("mountdoomskull");
        bot.Quests.EnsureAccept(3596);

        bot.Player.HuntForItem("Chaos Drow|Chaos Spider|Chaos Warrior|Chaorrupted Mage", "Chaos Power Increased", 6, true);

        bot.Quests.EnsureComplete(3596);

        bot.Wait.ForDrop("Dage's Scroll Fragment");
        bot.Player.Pickup("Dage's Scroll Fragment");
    }
Пример #12
0
        public WinFormsLegacyWebview(string hostAddress, WebviewBridge bridge)
        {
            if (hostAddress == null)
            {
                throw new ArgumentNullException(nameof(hostAddress));
            }
            if (bridge == null)
            {
                throw new ArgumentNullException(nameof(bridge));
            }

            this.hostAddress = new Uri(hostAddress, UriKind.Absolute);

            webview = new WebBrowser
            {
                IsWebBrowserContextMenuEnabled = false,
                TabStop                    = false,
                AllowNavigation            = true,
                AllowWebBrowserDrop        = false,
                ScriptErrorsSuppressed     = true,
                WebBrowserShortcutsEnabled = false,
            };

            scriptInterface            = new ScriptInterface(bridge);
            webview.Navigating        += Webview_Navigating;
            webview.DocumentCompleted += Webview_DocumentCompleted;
        }
Пример #13
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.PrivateRooms          = true;
        bot.Options.InfiniteRange         = true;
        bot.Options.ExitCombatBeforeQuest = true;

        bot.Skills.Add(1, 2f);
        bot.Skills.Add(2, 2f);
        bot.Skills.Add(3, 2f);
        bot.Skills.Add(4, 2f);

        bot.Skills.StartTimer();

        int q = 4829;

        bot.Player.Join("beehive");

        while (!bot.ShouldExit())
        {
            bot.Quests.EnsureAccept(q);
            bot.Player.HuntForItem("Stinger", "Honey Gathered", 10, tempItem: true);
            bot.Quests.EnsureComplete(q);
        }
    }
Пример #14
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.ExitCombatBeforeQuest = true;

        bot.Skills.LoadSkills("/Skills/Generic");
        bot.Skills.StartTimer();

        while (!bot.ShouldExit() && bot.Inventory.GetQuantity("Blood Moon Token") < 300)
        {
            bot.Quests.EnsureAccept(6059);
            if (bot.Map.Name != "bloodmoon")
            {
                bot.Player.Join("bloodmoon");
            }
            bot.Player.Jump("r4a", "Left");
            bot.Options.AggroMonsters = true;
            bot.Player.KillForItem("Lycan Guard", "Moon Stone", 20);
            bot.Options.AggroMonsters = false;
            bot.Player.WalkTo(8, 272);
            bot.Player.Jump("r12a", "Left");
            bot.Player.KillForItem("Black Unicorn", "Black Blood Vial", 16);
            bot.Player.WalkTo(8, 274);
            while (bot.Quests.CanComplete(6059))
            {
                bot.Quests.EnsureComplete(6059);
                bot.Quests.EnsureAccept(6059);
                bot.Sleep(1200);
            }
            bot.Player.Pickup("Blood Moon Token");
        }
    }
Пример #15
0
    public void combatClassHandler(ScriptInterface bot, double health)
    {
        if (!(bot.Inventory.Contains(FARM_CLASS) && bot.Bank.Contains(FARM_CLASS)))
        {
            return;
        }
        if (!(bot.Inventory.Contains(SOLO_CLASS) && bot.Bank.Contains(SOLO_CLASS)))
        {
            return;
        }

        bot.Skills.StopTimer();
        bot.Skills.Clear();

        string nextClass = "";

        if (health > 6000)
        {
            nextClass = SOLO_CLASS;
        }
        else
        {
            nextClass = FARM_CLASS;
        }

        bot.Player.EquipItem(nextClass);
        bot.Skills.LoadSkills("./Skills/" + nextClass.Replace(" ", "") + ".xml");
        bot.Skills.StartTimer();
    }
Пример #16
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings = true;
        bot.Options.RestPackets = true;

        bot.Skills.StartTimer();

        bot.Player.LoadBank();
        bot.Inventory.BankAllCoinItems();

        bot.Bank.ToInventory("Essence of Nulgath");
        bot.Bank.ToInventory("Voucher of Nulgath (non-mem)");
        bot.Bank.ToInventory("Totem of Nulgath");
        //4778

        if (bot.Map.Name != "tercessuinotlim")
        {
            bot.Player.Join("citadel", "m22", "Right");
            bot.Player.Join("tercessuinotlim", "Enter", "Spawn");
        }

        while (!bot.ShouldExit() && !bot.Inventory.Contains("Totem of Nulgath", 30))
        {
            bot.Quests.EnsureAccept(4778);

            bot.Player.HuntForItem("Dark Makai", "Essence of Nulgath", 60);

            bot.Player.Jump("Enter", "Spawn");
            bot.Quests.EnsureComplete(4778, 5357);

            bot.Wait.ForPickup("Totem of Nulgath");
            bot.Player.Pickup("Totem of Nulgath");
        }
    }
Пример #17
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.ExitCombatBeforeQuest = true;
        bot.Options.InfiniteRange         = true;
        bot.Options.PrivateRooms          = true;

        bot.Skills.StartTimer();


        while (true)
        {
            if (bot.Quests.CanComplete(6777))
            {
                bot.Quests.EnsureComplete(6777);
            }

            bot.Quests.EnsureAccept(6777);

            if (bot.Map.Name != "battleontown")
            {
                bot.Player.Join("battleontown");
            }

            while (!bot.Quests.CanComplete(6777))
            {
                bot.Player.Hunt("Chickencow");
            }
        }
    }
Пример #18
0
        /// <summary>
        /// Run the script!
        /// </summary>
        /// <param name="KeepRunning">Keep running or run once?</param>
        /// <param name="scriptname">The name of the class of the script that extends scriptinterface, if already loaded using ReadScript</param>
        public static void RunScript(bool KeepRunning, string scriptname)
        {
            int             index  = scriptsname.IndexOf(scriptname);
            ScriptInterface script = scripts[index];

            RunScript(KeepRunning, script);
        }
Пример #19
0
    public void FarmNulgath(ScriptInterface bot, string item, int quantity)
    {
        bot.Bank.ToInventory(item);
        if (bot.Inventory.Contains(item, quantity))
        {
            return;
        }

        bot.Quests.EnsureAccept(2566);
        bot.Player.Join("gilead");
        bot.Player.HuntForItem("Mana Elemental", "Charged Mana Energy for Nulgath", 1, true);
        bot.Player.Join("elemental");
        bot.Player.HuntForItem("Mana Golem", "Mana Energy for Nulgath", 1, true);
        bot.Player.AddTempItem(6135, 100000);
        bot.Player.AddTempItem(15385, 100000);
        bot.Player.Jump("Enter", "Spawn");

        int accum = 0;

        while (!bot.Inventory.Contains(item, quantity))
        {
            bot.Quests.EnsureAccept(2566);
            bot.Quests.EnsureComplete(2566);

            accum++;
            if (accum == 10)
            {
                accum = 0;
                bot.Player.Pickup("Unidentified 13", "Voucher of Nulgath (non-mem)", "Voucher of Nulgath", "Gem of Nulgath", "Dark Crystal Shard", "Tainted Gem", "Totem of Nulgath", "Unidentified 10", "Diamond of Nulgath");
                bot.Player.RejectExcept("Unidentified 13", "Voucher of Nulgath (non-mem)", "Voucher of Nulgath", "Gem of Nulgath", "Dark Crystal Shard", "Tainted Gem", "Totem of Nulgath", "Unidentified 10", "Diamond of Nulgath");
            }
        }
    }
Пример #20
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings = true;
        bot.Quests.EnsureAccept(802);
        if (bot.Quests.IsDailyComplete(802))
        {
            MessageBox.Show("Daily quest has already been completed!");
        }
        else
        {
            bot.Skills.StartTimer();
            bot.Options.RestPackets = true;

            bot.Player.Join("arcangrove", "Right", "Right");

            while (!bot.Inventory.ContainsTempItem("Slain Gorillaphant", 50))
            {
                bot.Player.Kill("Gorillaphant");
            }

            bot.Player.Jump("Back", "Right");            //Get out of combat before turning in quest.

            bot.Quests.EnsureComplete(802);

            bot.Wait.ForDrop("Elder's Blood");
            bot.Player.Pickup("Elder's Blood");
        }
    }
Пример #21
0
 public void OnTargetReset(ScriptInterface bot)
 {
     if (ResetOnTarget)
     {
         Root.Reset();
     }
 }
Пример #22
0
    public void ScriptMain(ScriptInterface instance)
    {
        bot = instance;

        CheckItems();

        InitOptions();
        InitSkills();
        InitDrops();

        while (!bot.ShouldExit())
        {
            if (!bot.Inventory.IsMaxStack("Darkon's Receipt"))
            {
                if (bot.Map.Name != "arcangrove")
                {
                    bot.Player.Join("arcangrove");
                    bot.Wait.ForMapLoad("arcangrove");
                }

                CheckQuest();

                bot.Player.HuntForItem("Gorillaphant", "Banana", 22, false, bot.Drops.RejectElse);

                bot.Sleep(1500);
            }
        }

        CleanUpScript();
    }
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.SafeTimings           = true;
        bot.Options.RestPackets           = true;
        bot.Options.PrivateRooms          = true;
        bot.Options.InfiniteRange         = true;
        bot.Options.ExitCombatBeforeQuest = true;

        if (bot.Skills.OverrideSkills == null)
        {
            bot.Skills.LoadSkills("./Skills/Generic.xml");
        }
        bot.Skills.StartTimer();

        bot.Player.LoadBank();
        bot.Inventory.BankAllCoinItems();

        // Shurpu Blaze Tokens for Pyromancer
        DailyRoutine(bot, "xancave", 2209, "Shurpu Ring Guardian", "Shurpu Blaze Token", 300);

        // Seals of Light and Darkness for Bright Knight Armor
        DailyRoutine(bot, "sepulchurebattle", 3825, "Ultra Sepulchure", "Seal of Darkness", 50);
        DailyRoutine(bot, "alteonbattle", 3826, "Ultra Alteon", "Seal of Light", 50);

        // Moglin MEAL for Moglin Pet.
        DailyRoutine(bot, "nexus", 4159, "Frogzard", "Moglin MEAL", 30);

        // Dage Scroll Fragment for Drakath's Armor
        DailyRoutine(bot, "mountdoomskull", 3596, "Chaos Spider", "Dage's Scroll Fragment", 30);

        // Shadow Shield for Shadowscythe General
        DailyRoutine(bot, "lightguardwar", 3828, "Lightguard Paladin|Citadel Crusader|Scorching Flame", "Shadow Shield", 500);

        // Various Ores from Necropolis
        // Change "false" to "true" if you have unlocked this quest.
        if (!bot.Quests.IsDailyComplete(2091))
        {
            string [] ores = { "Aluminum", "Barium", "Gold", "Iron", "Copper", "Silver", "Platinum" };
            bot.Quests.EnsureAccept(2091);
            bot.Player.Join("stalagbite");
            bot.Player.HuntForItem("Balboa", "Axe of the Prospector", 1);
            bot.Player.HuntForItem("Balboa", "Raw Ore", 30, tempItem: true);
            bot.Quests.EnsureComplete(2091);

            foreach (string o in ores)
            {
                if (bot.Player.DropExists(o))
                {
                    bot.Bank.ToInventory(o);
                    bot.Player.Pickup(o);
                    bot.Log(o + "(" + bot.Inventory.GetQuantity(o) + ")");
                    bot.Inventory.ToBank(o);
                }
            }
        }

        bot.Player.Join("yulgar");
        bot.Exit();
    }
Пример #24
0
 private bool ManaUseRule(ScriptInterface bot, bool greater, int mana)
 {
     if (greater)
     {
         return(bot.Player.Mana >= mana);
     }
     return(bot.Player.Mana <= mana);
 }
Пример #25
0
    public void ScriptMain(ScriptInterface bot)
    {
        bot.Options.RestPackets = true;
        bot.Options.SafeTimings = true;

        bot.Player.KillForItem("Guru Chest", "Pink Star Diamond of Nulgath", 1);
        bot.Player.Pickup("Pink Star Diamond of Nulgath");
    }
Пример #26
0
 public Location(string map, string cell, string pad)
 {
     Bot          = null;
     Map          = map;
     Cell         = cell;
     Pad          = pad;
     Requirements = new List <Requirement>();
 }
Пример #27
0
 private void ToBankRoutine(ScriptInterface bot)
 {
     bot.Log("Sending quest items to bank to conserve space");
     bot.Inventory.ToBank("Aeacus Empowered");
     bot.Inventory.ToBank("Tethered Soul");
     bot.Inventory.ToBank("Darkened Essence");
     bot.Inventory.ToBank("Dracolich Contract");
 }
Пример #28
0
 private void ToInventoryRoutine(ScriptInterface bot)
 {
     bot.Log("Sending quest items to inventory for quest completion...");
     bot.Bank.ToInventory("Aeacus Empowered");
     bot.Bank.ToInventory("Tethered Soul");
     bot.Bank.ToInventory("Darkened Essence");
     bot.Bank.ToInventory("Dracolich Contract");
 }
Пример #29
0
 public static string GetData(WebBrowser webBrowser, string NameMovie, string NameField)
 {
     ScriptInterface.WaitEvent = true;
     webBrowser.Document.InvokeScript("SetVariable", new Object[] {
         String.Format("CurMovie={0}&CurField={1}&GetData=1", NameMovie, NameField)
     });
     return(ScriptInterface.ForWaitGetData());
 }
Пример #30
0
        public bool?ShouldUse(ScriptInterface bot)
        {
            if (string.IsNullOrWhiteSpace(UseRule[_Index]))
            {
                return(true);
            }
            string[] useRules  = UseRule[_Index].Split((char[])null, StringSplitOptions.RemoveEmptyEntries);
            bool     shouldUse = true;
            bool     skip      = UseRule[_Index].Contains("s");

            foreach (string useRule in useRules)
            {
                int.TryParse(RemoveLetters(useRule), out int result);
                if (useRule.Contains("h"))
                {
                    if (result > 100)
                    {
                        result = 100;
                    }
                    if (useRules.Contains(">"))
                    {
                        shouldUse = HealthUseRule(bot, true, result);
                    }
                    else
                    {
                        shouldUse = HealthUseRule(bot, false, result);
                    }
                }
                else if (useRule.Contains("m"))
                {
                    if (result > 100)
                    {
                        result = 100;
                    }
                    if (useRules.Contains(">"))
                    {
                        shouldUse = ManaUseRule(bot, true, result);
                    }
                    else
                    {
                        shouldUse = ManaUseRule(bot, false, result);
                    }
                }
                else if (useRule.Contains("w"))
                {
                    WaitUseRule(bot, result);
                }
                if (skip && !shouldUse)
                {
                    return(null);
                }
                if (!shouldUse)
                {
                    break;
                }
            }
            return(shouldUse);
        }
Пример #31
0
		/// <summary>
		/// Default constructor
		/// </summary>
		public Spell()
		{
			IsDisposed = false;
			Script = new ScriptInterface<ISpell>();
			Level = 1;
		}
Пример #32
0
        public static ScriptInterface InitControlParam(string DivId, bool webGL)
        {
            if (Singleton.RenderContext.Device == null)
            {
                scriptInterface = new ScriptInterface();
                scriptInterface.Settings = Settings.Current;

                CanvasElement canvas = CreateCanvasElement(DivId);

                String webgltext = "experimental-webgl";
                GL gl = null;

                //todo remove this line to turn WebGL on...
                webGL = false;

                if (webGL)
                {
                    gl = (GL)(Object)canvas.GetContext((Rendering)(object)webgltext);
                }

                if (gl == null)
                {

                    CanvasContext2D ctx = (CanvasContext2D)canvas.GetContext(Rendering.Render2D);

                    Singleton.RenderContext.Device = ctx;

                }
                else
                {
                    Tile.PrepDevice = gl;
                    Singleton.RenderContext.gl = gl;
                }

                Singleton.Canvas = canvas;
                Singleton.RenderContext.Width = canvas.Width;
                Singleton.RenderContext.Height = canvas.Height;
                Singleton.Setup(canvas);

                Singleton.RenderContext.BackgroundImageset =
                    Imageset.Create(
                    "DSS",
                    "http://cdn.worldwidetelescope.org/wwtweb/dss.aspx?q={1},{2},{3}",
                    ImageSetType.Sky, BandPass.Visible, ProjectionType.Toast, 100,
                    0, 12, 256, 180, ".png", false, "", 0, 0, 0, false,
                    "http://www.worldwidetelescope.org/thumbnails/DSS.png",
                    true, false, 0, 0, 0, "", "", "", "", 1, "Sky");

                if (StartMode == "earth")
                {
                    Singleton.RenderContext.BackgroundImageset =
                        Imageset.Create(
                        "Blue Marble",
                        "http://www.worldwidetelescope.org/wwtweb/tiles.aspx?q={1},{2},{3},bm200407",
                        ImageSetType.Earth, BandPass.Visible, ProjectionType.Toast, 101,
                        0, 7, 256, 180, ".png", false, "", 0, 0, 0, false,
                        "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=bm200407",
                        true, false, 0, 0, 0, "", "", "", "", 6371000, "Earth");

                }
                if (StartMode == "bing")
                {
                    Singleton.RenderContext.BackgroundImageset =
                     Imageset.Create(
                     "Virtual Earth Aerial",
                     "http://a{0}.ortho.tiles.virtualearth.net/tiles/a{1}.jpeg?g=15",
                     ImageSetType.Earth, BandPass.Visible, ProjectionType.Mercator, 102,
                     1, 20, 256, 360, ".png", false, "0123", 0, 0, 0, false,
                     "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=earth",
                     true, false, 0, 0, 0, "", "", "", "", 6371000, "Earth");
                }

                //if (StartMode == "bing")
                //{
                //    Singleton.RenderContext.BackgroundImageset =
                //     Imageset.Create(
                //     "3D Solar System View",
                //     "",
                //     ImageSetType.SolarSystem, BandPass.Visible, ProjectionType.Toast, 10112,
                //     1, 20, 256, 360, ".png", false, "0123", 0, 0, 0, false,
                //     "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=SolarSytem",
                //     true, false, 0, 0, 0, "", "", "", "", 6371000, "3D Solar System View");
                //}

            }

            //UseUserLocation()

            Singleton.RenderContext.ViewCamera.Lng += 0;

            Singleton.RenderContext.InitGL();

            Singleton.Render();

            return scriptInterface;
        }
Пример #33
0
		/// <summary>
		/// Loads monster definition
		/// </summary>
		/// <param name="xml">XmlNode handle</param>
		/// <returns></returns>
		public override bool Load(XmlNode xml)
		{
			if (xml == null || xml.Name.ToLower() != XmlTag)
				return false;

			Name = xml.Attributes["name"].Value;

			foreach (XmlNode node in xml)
			{
				string value = "";
				if (node.Attributes["value"] != null)
					value = node.Attributes["value"].Value;

				switch (node.Name.ToLower())
				{
					case "attackspeed":
					{
						AttackSpeed = TimeSpan.FromMilliseconds(int.Parse(node.Attributes["value"].Value));
					}
					break;

					case "location":
					{
						if (Location != null)
							Location.Load(node);
					}
					break;

					case "direction":
					{
						Direction = (CardinalPoint)Enum.Parse(typeof(CardinalPoint), node.Attributes["value"].Value);
					}
					break;

					case "tiles":
					{
						TileSetName = node.Attributes["name"].Value;
						Tile = int.Parse(node.Attributes["id"].Value);
					}
					break;

					case "pocket":
					{
						ItemsInPocket.Add(node.Attributes["item"].Value);
					}
					break;

					case "script":
					{
						Script = new ScriptInterface<IMonster>();
						Script.Load(node);
					}
					break;

					case "damage":
					{
						DamageDice.Load(node);
					}
					break;

					case "hitdice":
					{
						HitDice.Load(node);
					}
					break;

					case "armorclass":
					{
						ArmorClass = int.Parse(value);
					}
					break;

					case "castinglevel":
					{
						MagicCastingLevel = int.Parse(value);
					}
					break;

					case "stealrate":
					{
						StealRate = float.Parse(value);
					}
					break;

					case "pickuprate":
					{
						PickupRate = float.Parse(value);
					}
					break;

					case "baseattack":
					{
						BaseAttack = int.Parse(value);
					}
					break;

					case "sightrange":
					{
						SightRange = byte.Parse(value);
					}
					break;

					case "behaviour":
					{
						DefaultBehaviour = (MonsterBehaviour)Enum.Parse(typeof(MonsterBehaviour), node.Attributes["default"].Value);
						CurrentBehaviour = (MonsterBehaviour)Enum.Parse(typeof(MonsterBehaviour), node.Attributes["current"].Value);
					}
					break;

					case "nonmaterial":
					{
						NonMaterial = bool.Parse(value);
					}
					break;

					case "poisonimmunity":
					{
						PoisonImmunity = bool.Parse(value);
					}
					break;

					case "canseeinvisible":
					{
						CanSeeInvisible = bool.Parse(value);
					}
					break;

					case "backrowattack":
					{
						BackRowAttack = bool.Parse(value);
					}
					break;

					case "teleports":
					{
						Teleports = bool.Parse(value);
					}
					break;

					case "usestairs":
					{
						UseStairs = bool.Parse(value);
					}
					break;

					case "fillsquare":
					{
						FillSquare = bool.Parse(value);
					}
					break;

					case "flees":
					{
						FleesAfterAttack = bool.Parse(value);
					}
					break;

					case "drains":
					{
						HasDrainMagic = bool.Parse(value);
					}
					break;

					case "heals":
					{
						HasHealMagic = bool.Parse(value);
					}
					break;

					case "throwweapons":
					{
						ThrowWeapons = bool.Parse(value);
					}
					break;

					case "flying":
					{
						Flying = bool.Parse(value);
					}
					break;

					case "smartai":
					{
						SmartAI = bool.Parse(value);
					}
					break;

					case "reward":
					{
						Reward = int.Parse(value);
					}
					break;

					case "weaponname":
					{
						WeaponName = node.Attributes["name"].Value;
					}
					break;

					case "sound":
					{
					}
					break;

					default:
					{
						base.Load(node);
					}
					break;
				}

			}

			return true;
		}
        private void AttachHandlerImpl()
        {
            var scriptInterface = new ScriptInterface(this, _context);

            _context.ObjectForScripting = scriptInterface;
            string js = @"window.alertProxy = window.alert;
                          window.windowOpenProxy = window.open;
                          window.confirmProxy = window.confirm;
                          
                          var customConfirm = function() {
                                return window.external.InterceptConfirm(arguments[0]);
                          }

                          var customWindowOpen = function() {
                             window.external.InterceptWindowOpen(arguments[0]);
                             " + (!_supressWindowOpen
                              ? @"return window.windowOpenProxy(arguments[0], arguments[1], arguments[2]);"
                              : @"") + @"
                          };
                          var customAlert = function() {
                                window.external.InterceptAlerts(arguments[0]);" +
                                (!_supressAlert
                                ? @"return window.alertProxy(arguments[0]);"
                                : @"return false;") +
                          @" };
                                
                                window.alert = customAlert;
                                window.open = customWindowOpen;
                                window.confirm = customConfirm;
                                var frameCount = window.frames.length, x = 0;
                                for (;x < frameCount; x++) 
                                {
                                    window.frames[x].confirm = customConfirm;
                                    window.frames[x].open = customWindowOpen;
                                    window.frames[x].alert = customAlert;
                                };";

            HtmlElement el = _context.Document.CreateElement("script");
            IHTMLScriptElement dom = (IHTMLScriptElement)el.DomElement;
            dom.text = js;
            if (_context.Document.Body != null)
            {
                _context.Document.Body.AppendChild(el);
            }


            HtmlElement jqueryEl = _context.Document.CreateElement("script");
            IHTMLScriptElement domJquery = (IHTMLScriptElement)el.DomElement;
            dom.src = "//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js";
            if (_context.Document.Body != null)
            {
                _context.Document.Body.AppendChild(jqueryEl);
            }
        }