Esempio n. 1
0
        //Color: 0x02B3  Graphic: 0x0FA0
        //---------------------------------------------------------------------------------------------

        private bool FishTile(int x, int y, sbyte z, out bool enemyDetected, out bool worthItem)
        {
            enemyDetected = false;
            worthItem     = false;
            bool result            = true;
            JournalEventWaiter jew = new JournalEventWaiter(true, "Lovit lze jen v hluboke vode", "There are no fish here", "That is too far away", "You pull out a nice fish", "Podarilo se ti chytit", "Try fishing in water", "You fish a while");

            Game.PrintMessage(String.Format("Chytam na {0}, {1}", x, y));
            UO.WaitTargetTileRel(x, y, z, 0);
            UO.UseType(FishingPole.Graphic);
            jew.Wait(3000);
            Game.Wait(50);

            if (Journal.Contains(true, "Lovit lze jen v hluboke vode", "There are no fish here", "That is too far away", "Try fishing in water"))
            {
                result = false;
            }

            if (Journal.Contains(true, "Kraken", "Sea Serpent"))
            {
                enemyDetected = true;
            }
            if (Journal.Contains(true, "Podarilo se ti chytit"))
            {
                worthItem = true;
            }

            Journal.Clear();
            return(result);
        }
Esempio n. 2
0
        public static void TrainArmsLore()
        {
            Journal.Clear();
            Game.PrintMessage("Vez ke zkoumani >");
            UOItem item = new UOItem(UIManager.TargetObject());

            while (item.Exist && !UO.Dead)
            {
                UO.UseSkill(StandardSkill.ArmsLore);
                UO.WaitTargetObject(item.Serial);
                Game.Wait(100);

                JournalEventWaiter jew = new JournalEventWaiter(true, "This item is", "You are uncertain about this item");

                UO.Print("Wait Start"); // + counter);
                jew.Wait(2000);
                UO.Print("Wait end");   //UO.Print("Wait :" + counter);
                //  int counter = 0;
                //while(Journal.WaitForText(true, 1500,"This item is", "You are uncertain about this item"))
                //{
                //  UO.Print("Wait :" + counter);
                //  Game.Wait(100);
                //  counter = counter + 100;
                //}
                Journal.Clear();
                //This item is
                //You are uncertain about this item
                Game.Wait(250);
            }
        }
Esempio n. 3
0
        //---------------------------------------------------------------------------------------------

        public static void TrainTinkering(UOColor color, Graphic product, params string[] menus)
        {
            UO.Print("Vyber container z ingoty:");
            UOItem containerFrom = new UOItem(UIManager.TargetObject());

            if (containerFrom.Exist)
            {
                UO.Print("containerFrom.Exist:");
                UOItem ingotSource = new UOItem(Serial.Invalid);

                UOItem ingot = new UOItem(Serial.Invalid);
                if (!(ingot = Mining2.FindIngot(UO.Backpack.Items, (int)Mining2.OreColor.Iron)).Exist || ingot.Amount < 20)
                {
                    ingot = Mining2.FindIngot(containerFrom.Items, (int)Mining2.OreColor.Iron);
                    ingot.Move(20, UO.Backpack.Serial);
                    Game.Wait();
                }

                UO.Print("while.Exist:" + color);

                while ((ingotSource = Mining2.FindIngot(containerFrom.Items, color)).Exist)
                {
                    UO.Print("while.Exist:");
                    ingotSource.Move(100, UO.Backpack.Serial);
                    Game.Wait();

                    while ((ingot = Mining2.FindIngot(UO.Backpack.Items, color)).Exist)
                    {
                        UO.Print("while2.Exist:");
                        JournalEventWaiter jew = new JournalEventWaiter(true, "You put the", "Tinkering failed");
                        UO.WaitMenu(menus);
                        UOItem tools = UO.Backpack.Items.FindType(TinkersTools);
                        if (tools.Exist)
                        {
                            tools.Use();
                            jew.Wait(7500);
                            if (Journal.Contains(true, "You can't make anything with what you have"))
                            {
                                Journal.Clear();
                                break;
                            }
                        }
                        else
                        {
                            UO.Print("Nejsou toolsy.");
                            break;
                        }
                    }

                    UOItem hinge = UO.Backpack.Items.FindType(product);
                    if (hinge.Exist)
                    {
                        hinge.Move(1000, containerFrom.Serial);
                        Game.Wait();
                    }
                }
            }
            UO.Print("Konec");
        }
Esempio n. 4
0
 public static void CraftPickAxes()
 {
     while (Mining2.FindIngot(UO.Backpack.AllItems).Exist&& UO.Backpack.AllItems.FindType(0x1BDD).Exist)//log
     {
         JournalEventWaiter jew = new JournalEventWaiter(true, "You put the", "You have failed");
         UO.WaitMenu("Blacksmithing", "Tools", "Tools", "Pick axe");
         Mining2.FindIngot(UO.Backpack.AllItems).Use();
         jew.Wait(6000);
     }
 }
Esempio n. 5
0
        public bool MixurePotion(Potion potion, PotionQuality quality, bool findInAll)
        {
            int    amount     = potion.GetAmountOrDefault(quality);
            UOItem invetoryRg = Reagent.FindReagentAll(UO.Backpack.Serial, potion.Reagent.Graphic, potion.Reagent.Color, amount);

            if (!invetoryRg.Exist)
            {
                Game.PrintMessage("Nejsou regy.", MessageType.Error);
                return(false);
            }

            if (!Mortar.Exist)
            {
                Game.PrintMessage("Neni mortar.", MessageType.Error);
                return(false);
            }
            Game.RunScript(amount * 6000);

            Game.PrintMessage("Micham:" + potion.Name + " - " + quality.ToString());
            Journal.Clear();

            Targeting.ResetTarget();
            UO.WaitMenu("Vyber typ potionu", potion.GetQualityDefinition(quality).MenuName);
            Mortar.Use();
            JournalEventWaiter jew = new JournalEventWaiter(true, "*You toss", "You can't make another potion now", "You completed the mixture in the mortar", "Musis mit v batuzku prazdnou lahev.");
            DateTime           dt1 = DateTime.Now;

            if (jew.Wait(60000))
            {
                if (Journal.Contains(true, "You can't make another potion now"))
                {
                    Game.Wait(4000);
                    return(true);
                }
                else if (Journal.Contains(true, "You toss"))
                {
                    return(true);
                }
                else if (Journal.Contains(true, "Musis mit v batuzku prazdnou lahev."))
                {
                    UIManager.Reset();
                    return(false);
                }
                else
                {
                    Mortar.Use();
                    if (Journal.WaitForText(false, 500, "You pour the completed"))
                    {
                        return(true);
                    }
                }
            }

            return(true);
        }
Esempio n. 6
0
        //---------------------------------------------------------------------------------------------

        protected SekInfo SekTree(StaticTarget tree)
        {
            SekInfo info = new SekInfo();

            Journal.Clear();

            JournalEventWaiter jew = new JournalEventWaiter(true, "akce skoncila");

            Nastroj.Use();
            UO.WaitTargetTile(tree.X, tree.Y, tree.Z, tree.Graphic);
            jew.Wait(10000 + LatencyMeasurement.CurrentLatency);

            info.Mined   = Journal.Contains(true, "There are no logs left here to chop");
            info.Wrong   = Journal.Contains(true, "You can't think of a way to use that item", "That's too far away to chop", "Try chopping a tree");
            info.Special = Journal.Contains(true, "You found something special");

            return(info);
        }
Esempio n. 7
0
        //---------------------------------------------------------------------------------------------


        public void TrainCarth()
        {
            Game.CurrentGame.Mode = GameMode.Working;
            if (this.Atlas.Exist)
            {
                bool prevOk = true;
                while (this.Atlas.Amount > 0)
                {
                    Journal.Clear();

                    if (prevOk)
                    {
                        UO.WaitTargetSelf();
                        this.Atlas.Use();
                        Game.Wait(350);
                    }

                    UO.WaitMenu("What sort of map do you want to draw ?", "Detail Map");
                    UO.UseType(0x14EB, 0x0000);
                    JournalEventWaiter jew = new JournalEventWaiter(true, "You put the map", "Thy trembling hand results in an unusable map");
                    jew.Wait(4000);

                    //if (Journal.Contains(true, "Thy trembling hand results in an unusable map"))
                    //{
                    //  prevOk = false;
                    //}
                    //else
                    //{
                    prevOk = true;
                    UO.WaitTargetType(0x14EB, 0x0000);
                    this.Atlas.Use();
                    Game.Wait();
                    //}
                    //Game.PrintMessage("Pocet map: " + this.Atlas.Amount);
                    Journal.Clear();
                }
            }
            else
            {
                Game.PrintMessage("Nemas u sebe atlas!");
            }
        }
Esempio n. 8
0
        public bool funcas()
        {
            UO.DeleteJournal();
            int select = 0;

            using (JournalEventWaiter obj = new JournalEventWaiter(ignoreCase, dirf))
            {
                obj.Wait(timeout);
            }

            foreach (string value in dirf)
            {
                if (Journal.Contains(value))
                {
                    MakeStep((byte)select);
                    UO.Print("KROK!");
                    return(true);
                }
                select++;
            }
            return(false);
        }
Esempio n. 9
0
        private static void MakeOneWire()
        {
            JournalEventWaiter jew = new JournalEventWaiter(true, "You put the", "Tinkering failed");

            UO.WaitMenu("Tinkering", "Wires", "Wires", "Iron Wire");
            UOItem tools = UO.Backpack.Items.FindType(TinkersTools);

            if (tools.Exist)
            {
                tools.Use();
                jew.Wait(7500);
                if (Journal.Contains(true, "You can't make anything with what you have"))
                {
                    Journal.Clear();
                }
            }
            else
            {
                UO.Print("Nejsou toolsy.");
                UO.Say(",terminateall");
            }
        }
Esempio n. 10
0
        //---------------------------------------------------------------------------------------------

        public void FillKadRecursive(Potion potion, PotionQuality quality)
        {
            UOItem p = UO.Backpack.Items.FindType(potion.DefaultGraphic, potion.DefaultColor);

            PotionQualityDefinition pqDef = potion.GetQualityDefinition(quality);
            UOColor kadColor    = pqDef != null ? pqDef.KadColor : potion.TopKadColor;
            UOColor potionColor = pqDef != null ? pqDef.Color : potion.DefaultColor;

            UOItem kad = FindKadAround(Potion.KadGraphic, kadColor);

            if (p.Exist && kad.Exist)
            {
                Journal.Clear();
                //Game.Wait(250);
                kad.Use();
                UO.WaitTargetObject(p);
                JournalEventWaiter jew = new JournalEventWaiter(true, "Tohle nejde");
                jew.Wait(250);
                if (UO.Backpack.Items.FindType(potion.DefaultGraphic, potionColor).Exist)
                {
                    FillKadRecursive(potion, quality);
                }
            }
        }
Esempio n. 11
0
        public void TameCharacter(UOCharacter character, int maxTries, bool keepDisttance)//, Robot r)
        {
            Game.CurrentGame.CurrentPlayer.SwitchWarmode();

            Robot r = new Robot();

            r.UseTryGoOnly     = true;
            r.SearchSuqareSize = 20;

            UOItem currentStaff = EnsuredTamingStaff;
            int    tries        = 0;

            Game.PrintMessage(String.Format("{0}, {1}, {2}, {3}, {4}", character.Exist, character.RequestStatus(500), character.Hits, character.Distance, UO.Dead));

            while (character.Exist && character.RequestStatus(500) && character.Hits > 0 && character.Distance < 6 && !UO.Dead)
            {
                UO.DeleteJournal();

                bool end  = false;
                bool kill = false;

                if (character.Distance > 2 && keepDisttance)
                {
                    r.GoTo(new UOPositionBase(character.X, character.Y, 0), 2, 2);
                    Game.Wait(500);
                }
                UO.Say("Baf");
                Game.Wait();

                UO.UseSkill("Hiding");
                Game.Wait();
                IRequestResult result = UO.WaitTargetObject(character.Serial);
                currentStaff.Use();
                //Game.Wait(500);
                SkillValue tamingValue = SkillsHelper.GetSkillValue("AnimalTaming");
                UOItem     robe        = World.Player.Layers[Layer.OuterTorso];
                Game.PrintMessage("RV: " + tamingValue.RealValue + " / " + robe.Exist);

                using (JournalEventWaiter jew = new JournalEventWaiter(true,
                                                                       "You can't see the target",
                                                                       "Ochoceni se nezdarilo",
                                                                       "Your taming failed",
                                                                       "byl tamnut",
                                                                       "not tamable",
                                                                       "You are not able to tame",
                                                                       "Jsi moc daleko",
                                                                       "Jeste nemuzes pouzit hulku",
                                                                       "toto zvire nelze ochocit",
                                                                       "Toto zvire nedokazes ochocit",
                                                                       "You are not able to tame this animal"

                                                                       ))
                {
                    if (jew.Wait(15000))
                    {
                        if (Journal.Contains(true, "Ochoceni se nezdarilo"))
                        {
                            Game.PrintMessage("Try - Ochoceni se nezdarilo");
                        }
                        else if (Journal.Contains(true, "Your taming failed"))
                        {
                            Game.PrintMessage("Try - Your taming failed");
                        }
                        else if (Journal.Contains(true, "Jeste nemuzes pouzit hulku"))
                        {
                            Game.PrintMessage("Try - Jeste nemuzes pouzit hulku");
                            Game.Wait(6000);
                        }
                        else if (Journal.Contains(true, "Jsi moc daleko"))
                        {
                            if (keepDisttance)
                            {
                                bool go = r.GoTo(new UOPositionBase(character.X, character.Y, 0), 1, 10);
                                if (!go)
                                {
                                    end = true;
                                }
                                Game.Wait();
                                Game.PrintMessage("Try - Jsi moc daleko: " + go);
                            }
                        }
                        else if (Journal.Contains(true, "You can't see the target"))
                        {
                            UO.WaitTargetCancel();
                            Game.Wait();
                            UO.Press(System.Windows.Forms.Keys.Escape);
                            Game.Wait();
                            Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                            Game.Wait();
                            bool go = r.GoTo(new UOPositionBase(character.X, character.Y, 0), 1, 10);
                            if (!go)
                            {
                                end = true;
                            }
                            Game.Wait();

                            Game.PrintMessage("Try - You can't see the target go: " + go);
                        }
                        else if (Journal.Contains(true, "byl tamnut"))// && currentStaff.Color == TamingStaff.Color)
                        {
                            Game.PrintMessage("End - byl tamnut");
                            end = true;
                        }
                        else if (Journal.Contains(true, "not tamable") || Journal.Contains(true, "toto zvire nelze ochocit"))
                        {
                            character.Click();
                            Game.Wait(500);
                            character.RequestStatus(500);

                            bool isTrofejAnimal = false;// TrofejKlamaci.Contains(character.Model);

                            foreach (Graphic g in TrofejKlamaci)
                            {
                                if (g == character.Model)
                                {
                                    isTrofejAnimal = true;
                                }
                            }


                            if (isTrofejAnimal && character.Notoriety != Notoriety.Innocent && character.Notoriety != Notoriety.Invulnerable && character.Notoriety != Notoriety.Guild)//krysa/hind/bear/goat/snake atd)TODO
                            {
                                kill = true;
                                //zabit / riznout / vylotit
                                Game.PrintMessage("Kill - not tamable " + character.Model);
                            }
                            else
                            {
                                Game.PrintMessage("End - not tamable");
                                end = true;
                            }
                        }
                        else if (Journal.Contains(true, "Toto zvire nedokazes ochocit") || Journal.Contains(true, "You are not able to tame this animal"))
                        {
                            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                                Game.Wait(500);
                            }
                            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                                Game.Wait(500);
                            }

                            if (tries > 1)
                            {
                                Game.PrintMessage("End - Nelze ochocit " + character.Serial);
                                end = true;
                            }

                            Game.Wait(3500);
                        }
                        else
                        {
                            Game.Wait(1000);
                        }
                    }
                    else
                    {
                        if (Game.CurrentGame.WorldSave())
                        {
                            Game.Wait(60000);
                            Game.PrintMessage("Try - WordSave" + character.Serial);
                        }
                        else
                        {
                            if (tries > 1)
                            {
                                Game.PrintMessage("End - JEW timeout " + character.Serial);
                                end = true;
                            }
                        }
                    }

                    if (tries > maxTries)// && currentStaff.Color == TrainTamingStaff.Color)
                    {
                        end = true;
                    }

                    if (tamingValue.RealValue < 1000 && maxTries < 100)
                    {
                        bool switchToTrain  = false;
                        bool switchToTaming = false;
                        if (tries == 0)
                        {
                            if ((Journal.Contains(true, "nenauc") || Journal.Contains(true, "You Cannot learn anything more")) && robe.Exist)
                            {
                                robe.Move(1, World.Player.Backpack);
                                Game.Wait();
                                switchToTrain = true;
                            }

                            if (!Journal.Contains(true, "nenauc"))
                            {
                                switchToTrain = true;
                            }
                        }
                        else if (tries == 1)
                        {
                            if (Journal.Contains(true, "nenauc") || Journal.Contains(true, "You Cannot learn anything more"))
                            {
                                switchToTaming = true;

                                Game.PrintMessage("robe.Exist:" + robe.Exist);

                                if (robe.Exist)
                                {
                                    robe.Use();
                                    Game.Wait();
                                }
                            }
                        }

                        if (switchToTrain)
                        {
                            if (World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color).Exist)
                            {
                                currentStaff = World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color);
                            }
                            else if (World.Player.Layers.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color).Exist)
                            {
                                currentStaff = World.Player.Backpack.AllItems.FindType(TrainTamingStaff.Graphic, TrainTamingStaff.Color);
                            }

                            Game.Wait();
                        }


                        if (switchToTaming)
                        {
                            currentStaff = EnsuredTamingStaff;
                            Game.Wait();
                        }
                    }
                    if (tries > 2)
                    {
                        if (Journal.Contains(true, "nenauc") || currentStaff.Color == TamingStaffCharged.Color && !World.Player.Layers[Layer.OuterTorso].Exist)
                        {
                            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                                Game.Wait();
                            }
                            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
                            {
                                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                                Game.Wait(500);
                            }
                        }
                    }

                    if (kill)
                    {
                        this.KillCharacter(character);
                    }

                    if (end)
                    {
                        Game.PrintMessage("While - end: " + tries);
                        //   doneList.Remove(character.Serial);
                        break;
                    }
                }
                tries++;
                Game.PrintMessage("While - cyklus pokus: " + tries);
            }

            foreach (UOItem item in World.Ground)
            {
                if (item.Distance < 5)
                {
                    bool isKlamak = false;
                    foreach (Graphic g in Taming2.ShrinkKlamaci)
                    {
                        if (item.Graphic == g)
                        {
                            isKlamak = true;
                        }
                    }

                    if (Array.IndexOf(ItemLibrary.ShrinkKlamaci.GraphicArray, item.Graphic) > -1 || Array.IndexOf(ShrinkKlamaci, item.Graphic) > -1 || isKlamak)
                    {
                        item.Move(1, (ushort)(World.Player.X + 1), (ushort)(World.Player.Y + 1), item.Z);
                        Game.Wait(150);
                        item.Move(1, World.Player.Backpack, 30, 30);
                        Game.Wait(150);
                    }
                }
            }

            Game.PrintMessage("While - END");
            if (World.Player.Backpack.AllItems.FindType(0x1F03).Exist)
            {
                World.Player.Backpack.AllItems.FindType(0x1F03).Use();
                Game.Wait(250);
            }
            else if (World.Player.Backpack.AllItems.FindType(0x1F01).Exist)
            {
                World.Player.Backpack.AllItems.FindType(0x1F01).Use();
                Game.Wait(250);
            }
        }
Esempio n. 12
0
        public void Train(string name, string quality, string drinkPotion, bool drink, int manaLimit, params string[] menus)
        {
            Game.PrintMessage("Zvol kontejner s materialem > (esc) = ground");
            UOItem containerFrom = new UOItem(UIManager.TargetObject());

            Game.CurrentGame.Mode = GameMode.Working;

            decimal okCountAlch = 0;
            decimal countAlch   = 0;

            decimal okCount = 0;
            decimal count   = 0;

            bool restart = true;

            while (!UO.Dead)
            {
                Journal.Clear();
                if (!World.Player.Backpack.AllItems.FindType(BlankScroll.Graphic, BlankScroll.Color).Exist)
                {
                    foreach (UOItem item in World.Player.Backpack.AllItems)
                    {
                        if (item.Graphic > 0x1F20 && item.Graphic < 0x1F99)
                        {
                            item.Move(10000, containerFrom);
                            Game.Wait(500);
                        }
                    }

                    UOItem sourceItem = containerFrom.Items.FindType(BlankScroll.Graphic, BlankScroll.Color);
                    if (sourceItem.Exist)
                    {
                        sourceItem.Move(100, World.Player.Backpack);
                        Game.Wait(500);
                    }
                    else
                    {
                        break;
                    }
                }

                if (World.Player.Mana > manaLimit)
                {
                    Game.PrintMessage("Write - " + String.Join(",", menus));
                    UO.UseType(BlankScroll.Graphic, BlankScroll.Color);
                    UO.WaitMenu(menus);
                    Journal.WaitForText(true, 7500, "You fail to inscribe", "You dont't know any", "You put");

                    count++;

                    if (Journal.Contains("You put"))
                    {
                        okCount++;
                    }


                    if (Journal.Contains("You dont't know any"))
                    {
                        Game.PrintMessage("Nemas suroviny");
                        break;
                    }


                    decimal okDivide = (okCount / count);
                    decimal okPerc   = okDivide * 100;
                    Game.PrintMessage("Ks: " + okCount + " / " + count + " - " + String.Format("{0:n} %", okPerc));
                }

                Potion p = PotionCollection.Potions.GetItemByName(drinkPotion);

                UOItem mrKad = null;

                if (p != null)
                {
                    mrKad = new UOItem(World.Player.Backpack.Items.FindType(Potion.KadGraphic, p.TopKadColor));
                    if (mrKad == null || !mrKad.Exist)
                    {
                        mrKad = World.Ground.FindType(Potion.KadGraphic, p.TopKadColor);
                    }
                }

//        Game.PrintMessage("" + (p != null) + " / " + (mrKad != null && mrKad.Exist));

                //new UOItem(World.Player.Backpack.Items.FindType(Potion.KadGraphic, Potion.ManaRefresh.TopKadColor));
                int manaOffset = 60;
                if (p != null && p.Name == "ManaRefresh")
                {
                    manaOffset = 25;
                }

                if (World.Player.Mana < manaLimit || (restart && World.Player.Mana < (World.Player.Intelligence - manaOffset)))
                {
                    restart = false;


                    if (drink && mrKad != null && mrKad.Exist)
                    {
                        Game.CurrentGame.CurrentPlayer.GetSkillInstance <Alchemy>().DrinkPotion(p);
                        Game.Wait(1500);
                        if (Journal.Contains("You can't drink", "You can't "))
                        {
                            Game.Wait(8000);
                            Journal.Clear();
                        }
                    }
                }

                if (World.Player.Mana < manaLimit)
                {
                    World.Player.ChangeWarmode(WarmodeChange.Peace);
                    Game.Wait(250);
                    int    counter     = 0;
                    bool   alchemyOK   = true;
                    double timeCounter = 0;
                    restart = true;
                    long   lastDrink = 0;
                    UOItem atlas     = World.Player.Backpack.AllItems.FindType(AtlasType.Graphic, AtlasType.Color);

                    //while (World.Player.Mana < World.Player.Intelligence)
                    //{
                    Journal.Clear();

                    DateTime start = DateTime.Now;
                    if (!String.IsNullOrEmpty(name) && !String.IsNullOrEmpty(quality) && alchemyOK)
                    {
                        Potion        potion = null;
                        PotionQuality pq     = Potion.ParsePQOrDefault(quality, PotionQuality.Lesser);
                        if ((potion = PotionCollection.Potions.GetItemByName(name)) != null)
                        {
                            Alchemy a = new Alchemy();

                            if (a.GetMixureReagent(containerFrom, potion, pq))
                            {
                                a.FillKadRecursive(potion, pq);
                                if (!a.MixurePotion(potion, pq, false))
                                {
                                    break;
                                }
                                else
                                {
                                    countAlch++;
                                    if (Journal.Contains(true, "You pour"))
                                    {
                                        okCountAlch++;
                                    }

                                    decimal okDivide    = (okCountAlch / countAlch);
                                    decimal okPerc      = okDivide * 100;
                                    int     regAmount   = potion.GetAmountOrDefault(pq);
                                    decimal pricePerPcs = (1 / (okDivide > 0 ? (okCountAlch / countAlch) : 1)) * (decimal)regAmount * 5.0m;//

                                    Game.PrintMessage("Ks: " + okCountAlch + " / " + String.Format("{0:n} %", okPerc) + " Prc: " + String.Format("{0:n} gp", pricePerPcs));
                                }
                            }
                            Game.PrintMessage("Trenovani dokonceno.");
                        }
                        else
                        {
                            alchemyOK = false;
                            Game.PrintMessage("Potion s nazvem " + name + " neexistuje", MessageType.Error);
                        }
                        //WatchDogHelper.Watch();
                    }
                    else if (atlas.Exist && atlas.Amount > 0)
                    {
                        //map 0x14EF

                        foreach (UOItem map in World.Player.Backpack.AllItems)
                        {
                            if (map.Graphic == 0x14EB && map.Color == 0x0000)
                            {
                                UO.WaitTargetObject(map);
                                atlas.Use();
                                Game.Wait();
                            }
                        }

                        if (!World.Player.Backpack.AllItems.FindType(0x14EB, 0x0000).Exist)
                        {
                            UO.WaitTargetSelf();
                            atlas.Use();
                            Game.Wait();
                        }

                        if (World.Player.Backpack.AllItems.FindType(0x14EB, 0x0000).Exist)
                        {
                            UO.WaitMenu("What sort of map do you want to draw ?", "Detail Map");
                            UO.UseType(0x14EB, 0x0000);
                            JournalEventWaiter jew = new JournalEventWaiter(true, "You put the map", "Thy trembling hand results in an unusable map");
                            jew.Wait(5000);
                        }
                    }
                    else if (World.Player.Backpack.AllItems.FindType(0x0E9D).Exist&& SkillsHelper.GetSkillValue("Musicianship").RealValue < 500)
                    {
                        UO.UseType(0x0E9D, 0x0000);
                        if (Journal.WaitForText(true, 2500, "You play poorly"))
                        {
                        }
                        //Game.Wait(1000);

                        if (Journal.Contains(true, " You are preoccupied with thoughts of battle"))
                        {
                            Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                            Game.Wait();
                        }
                    }
                    else if (World.Player.Backpack.AllItems.FindType(0x1438).Exist&& SkillsHelper.GetSkillValue("ItemIdentification").RealValue < 1000)//war hamer
                    {
                        UO.WaitTargetType(0x1438);
                        UO.UseSkill(StandardSkill.ItemIdentification);
                        Game.Wait(1500);
                    }
                    //else if (SkillsHelper.GetSkillValue("DetectingHidden").RealValue < 150)
                    //{
                    //  UO.UseSkill(StandardSkill.DetectingHidden);
                    //  Game.Wait(1000);
                    //}

                    else
                    {
                        UO.UseSkill(StandardSkill.Meditation);
                        Game.Wait(2500);
                    }

                    Game.Wait(100);
                    counter++;



                    double elapsedTime = (DateTime.Now - start).TotalMilliseconds;
                    timeCounter += elapsedTime;

                    int longpartCount = (int)Math.Truncate(timeCounter) / 5000;
                    Game.PrintMessage("Cas:" + (longpartCount * 5000) + " / " + ((longpartCount * 5000) - lastDrink));

                    if ((longpartCount * 5000) - lastDrink > 10000)
                    {
                        lastDrink = (longpartCount * 5000);
                        if (drink && mrKad != null && mrKad.Exist && World.Player.Mana < (World.Player.Intelligence - manaOffset))//        if (World.Player.Mana < 50 || (restart && World.Player.Mana < (World.Player.Intelligence - manaLimit)))
                        {
                            Journal.Clear();
                            Game.CurrentGame.CurrentPlayer.GetSkillInstance <Alchemy>().DrinkPotion(p);
                            Game.Wait(1500);
                        }
                    }
                    //}
                }
            }
        }
Esempio n. 13
0
        public static void MakeVlasce()
        {
            UO.Print("Vyber container s matrosem:");
            UOItem containerFrom = new UOItem(UIManager.TargetObject());

            ItemHelper.EnsureContainer(containerFrom);

            if (containerFrom.Exist)
            {
                while (containerFrom.Items.FindType(Thread.Graphic, Thread.Color).Amount > 4 && containerFrom.Items.FindType(IronWire.Graphic, IronWire.Color).Amount > 2)
                {
                    if (UO.Backpack.Items.FindType(Thread.Graphic, Thread.Color).Amount < 4)
                    {
                        UO.Backpack.Items.FindType(Vlasec.Graphic, Vlasec.Color).Move(100, containerFrom);
                        Game.Wait();
                        containerFrom.Items.FindType(Thread.Graphic, Thread.Color).Move(80, UO.Backpack);
                        Game.Wait();
                    }

                    if (UO.Backpack.Items.FindType(IronWire.Graphic, IronWire.Color).Amount < 2)
                    {
                        containerFrom.Items.FindType(IronWire.Graphic, IronWire.Color).Move(40, UO.Backpack);
                        Game.Wait();
                    }

                    while (UO.Backpack.Items.FindType(IronWire.Graphic, IronWire.Color).Amount >= 2 && UO.Backpack.Items.Count(IronString.Graphic, IronString.Color) < 2)
                    {
                        string[]           menus = new string[] { "Tinkering", "Wires", "Wires", "Iron String" };
                        JournalEventWaiter jew   = new JournalEventWaiter(true, "You put the", "Tinkering failed");
                        UO.WaitMenu(menus);
                        UOItem tools = UO.Backpack.Items.FindType(TinkersTools);
                        if (tools.Exist)
                        {
                            tools.Use();
                            jew.Wait(7500);
                            if (Journal.Contains(true, "You can't make anything with what you have"))
                            {
                                Journal.Clear();
                                break;
                            }
                        }
                        else
                        {
                            UO.Print("Nejsou toolsy.");
                            break;
                        }
                    }

                    if (UO.Backpack.Items.FindType(Thread.Graphic, Thread.Color).Amount >= 4 && UO.Backpack.Items.Count(IronString.Graphic, IronString.Color) >= 2)
                    {
                        JournalEventWaiter jew = new JournalEventWaiter(true, "You put the", "Tinkering failed");
                        UO.WaitMenu("Tinkering", "Wires", "Wires", "Vlasec");
                        UOItem tools = UO.Backpack.Items.FindType(TinkersTools);
                        if (tools.Exist)
                        {
                            tools.Use();
                            jew.Wait(7500);
                            if (Journal.Contains(true, "You can't make anything with what you have"))
                            {
                                Journal.Clear();
                                break;
                            }
                        }
                        else
                        {
                            UO.Print("Nejsou toolsy.");
                            break;
                        }
                    }
                }
            }

            Game.PrintMessage("Konec make vlasce");
        }
Esempio n. 14
0
        public void TrainPoisEngage()
        {
            if (IsRunning)
            {
                return;
            }
            IsRunning = true;

            UOItem trainKit = World.Player.Backpack.AllItems.FindType(TrainKit.Graphic, TrainKit.Color);

            if (trainKit.Exist)
            {
                IsRunning = true;
                List <UOCharacter> characters = new List <UOCharacter>();
                characters.AddRange(World.Characters.ToArray());
                var fiter = characters.Where(ch => (ch.Notoriety != Notoriety.Guild && (ch.Notoriety == Notoriety.Enemy || ch.Notoriety == Notoriety.Murderer || ch.Notoriety == Notoriety.Criminal || ch.Notoriety == Notoriety.Neutral)) &&
                                             ch.Serial != World.Player.Serial &&
                                             ch.Distance <= 1 &&
                                             !Game.IsMob(ch.Serial) &&
                                             !Game.IsMobRenamed(ch.Serial) &&
                                             !ch.Renamable &&
                                             !(ItemLibrary.IsMostCommonPlayerSummon(ch)));

                int  done    = 0;
                bool success = false;

                foreach (UOCharacter ch in fiter)
                {
                    if (!this.doneList.Contains(ch.Serial))
                    {
                        Game.RunScriptCheck(1000);
                        Game.CurrentGame.CurrentPlayer.SwitchWarmode();
                        Game.Wait(250);
                        UO.WaitTargetObject(ch.Serial);
                        trainKit.Use();

                        JournalEventWaiter jew = new JournalEventWaiter(true, "Uspesne jsi otravil svuj cil", "Kdyz se snazis pracovat s jedem, nemel bys delat nic jineho", "Na tomhle nemuzes trenovat", "Z teto nestvury se nic noveho nenaucis", "Na cili j*z nekdo trenoval");//todo
                        jew.Wait(500);

                        if (Journal.Contains(true, "Uspesne jsi otravil svuj cil", "Na tomhle nemuzes trenovat", "Z teto nestvury se nic noveho nenaucis", "Na cili j*z nekdo trenoval"))
                        {
                            this.doneList.Add(ch.Serial);
                            success = true;
                        }

                        Journal.Clear();
                        break;
                    }
                    else
                    {
                        done++;
                    }
                }

                if (!success && done > 0)
                {
                    World.Player.PrintMessage("Vse okolo poisnuto!");
                }
                else if (fiter.Count() == 0)
                {
                    World.Player.PrintMessage("Nic k poisnuti!");
                }
            }
            else
            {
                World.Player.PrintMessage("Nemas pois KIT");
            }

            IsRunning = false;
        }
Esempio n. 15
0
        /// <summary>
        /// Waits until one of requested strings does not appear in journal.
        /// </summary>
        /// <param name="ignoreCase">If true character case is ignored.</param>
        /// <param name="timeout">Time in milliseconds before function times out. Use -1 to wait for infinite.</param>
        /// <param name="text">List of text that script is waiting for.</param>
        /// <returns>Returns true if text appeared in journal. False when timeout.</returns>
        public static bool WaitForText(bool ignoreCase, int timeout, params string[] text)
        {
            using (JournalEventWaiter obj = new JournalEventWaiter(ignoreCase, text)) {
                if (Contains(ignoreCase, text))
                    return true;

                return obj.Wait(timeout);
            }
        }