Magery Train - Sipka (target bandy/regy)

Datum: 8/06/2013 09:46:13

Staženo: 1784x

Popis:

Script na tréning magery.

 

Možné nastavit ve scriptu:

  • TMR/MR/MEDITACE <- jejich kombinace
  • Targetuje Kontainer s bandy a regy

 

Healí to... 


Hodnocení: 3.5/10 (132 hlasy)

Download file:cs

Příkazy:

  • ,magerytrain

Kód:

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using Phoenix;
using Phoenix.WorldData;

namespace Scripts.smocehoscripty
{
    public class MageryTrain
    {

        /// <summary>
        /// Způsob doplňování many:
        /// 1 - Jen Potion
        /// 2 - Jen Meditace
        /// 3 - Meditace + Potion 
        /// </summary>
        public const int zpusob = 3;

        /// <summary>
        /// Druh Mana potionu:
        /// 1 - TMR
        /// 2 - MR 
        /// </summary>
        public const int drink = 2;

        /// <summary>
        /// Zapnout PRINT hlasky:
        /// True - Ano 
        /// False - Ne
        /// </summary>
        public const bool print = true;

         

        /// <summary>
        /// Zadej pocet kolik band ma prenaset a regu
        /// </summary>
        public const int prenest_bandy = 202;


        /// <summary>
        /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// </summary>
        /// 
        #region Define_other

        private UOItem box_bandy;
        private UOItem box_regy;  
        private int statistikas  = 0; 
        private int min_mana_potrebna = 5;

        private struct TMR
        {
            public const ushort Keg_t = 0x1843;
            public const ushort Keg_c = 0x0003;
            public const ushort type = 0x0F09;
            public const ushort color = 0x0003;
        }

        private struct ManaRef
        {
            public const ushort Keg_t = 0x1843;
            public const ushort Keg_c = 0x0005;
            public const ushort type = 0x0F09;
            public const ushort color = 0x0005;
        }

     
    
      
        public const ushort BP = 0x0F7A; 
        public const ushort NS = 0x0F88; 
 
    #endregion


        [Command("magerytrain")]
        [BlockMultipleExecutions("magerytrain")]
        public void magerytrain()
        {
            target_box();
           
                UO.Print("Dneska budeme Magery delat");
                 
                  
                    min_mana_potrebna = 5;

            

            while (!World.Player.Dead)
            {
                check_heal();
                check_heal();
                UO.Wait(300);
                check_regy();
                UO.Wait(300);
                check_bandy();
                UO.Wait(500);
                check_mana();
                check_mana();
                UO.Wait(300);
                magerus();
                UO.Wait(300);
            }

            info("Konec programu");

        }

        private void magerus()
        {

            if (World.Player.Mana > min_mana_potrebna)
            {
                while (World.Player.Mana > min_mana_potrebna && World.Player.Hits >= 20 && UO.Count(BP) > 0 && UO.Count(NS) > 0 )
                {
                    UO.Cast("Magic Arrow", Aliases.Self);
                    UO.Wait(2000);
                    statistikas++;
                    statistika();
                } 
            }

        }

        private void statistika()
        { 
            UO.Print(0x055A, "Celkem: {0} ", statistikas); 
        }

        private void check_heal()
        {
            if (World.Player.Hits < 20)
            {
                UOItem bandage = World.Player.Backpack.AllItems.FindType(0x0E21);
                if (bandage.Serial != Serial.Invalid)
                {
                    while (World.Player.Hits < World.Player.MaxHits)
                    {
                        check_bandy();
                        if (bandage.Serial != Serial.Invalid)
                        {
                            bandage = World.Player.Backpack.AllItems.FindType(0x0E21);
                            if(!bandage.Exist)
                            {
                                info(0x002B, "Nemáš bandy"); UO.TerminateAll();
                            }
                        }
                        UO.WaitTargetSelf();
                        bandage.Use();
                        UO.Wait(4000);
                       
                    }

                }
                else
                {
                    check_bandy();
                }
            }
        }

        private void check_mana()
        {
            if (World.Player.Mana < min_mana_potrebna)
            {
#pragma warning disable
                info(0x0116, "Malo Many, jdu to resit");
                switch (zpusob)
                {
                    case 1:
                        piti();
                        break;
                    case 2:
                        meditace();
                        break;
                    case 3:
                        piti();
                        meditace();
                        break;
                    default:
                        info("Chyba v nastaveni zpusobu doplnovani many!!!!");
                        meditace();
                        break;
                }
#pragma warning restore

            }

        }

        private void check_bandy()
        {
            if (UO.Count(0x0E21) == 0)
            {
                if (!box_bandy.Opened) { box_bandy.Use(); UO.Wait(500); }
                info(0x002B, "Prenasim " + prenest_bandy.ToString() + " bandy do backpacku");

                UOItem blanks = new UOItem(box_bandy.AllItems.FindType(0x0E21));
                if (!blanks.Exist) { info(0x002B, "Nejdou pretahnout bandy do backpacku  ... KONEC"); UO.TerminateAll(); }
                blanks.Move(prenest_bandy, World.Player.Backpack);
                info(0x0116, "Bandy nabrane!");
                UO.Wait(300);

                if (UO.Count(0x0E20) > 0)
                {
                    UOItem blankq = World.Player.Backpack.AllItems.FindType(0x0E20);
                    if (!blankq.Exist) { info(0x002B, "Nejdou pretahnout bandy do boxu  ... KONEC"); UO.TerminateAll(); }
                    UO.MoveItem(blankq.Serial,0,box_bandy.Serial);
                    info(0x0116, "Bandy Odhozene!");
                    UO.Wait(300);
                }
            }
           
        }

        private void check_regy()
        {

            if (UO.Count(BP) == 0)
            {
                if (!box_regy.Opened) { box_regy.Use(); UO.Wait(500); }
                UOItem regs1 = new UOItem(box_regy.AllItems.FindType(BP));
                if (!regs1.Exist) { info("Nenalezeny reg typu 1.. Viz DP. web ... KONEC"); UO.TerminateAll(); }
                regs1.Move(100, World.Player.Backpack);
                info(0x002B, "Doplneni regu 1");
                UO.Wait(300);
            }
            if (UO.Count(NS)==0)
            {
                if (!box_regy.Opened) { box_regy.Use(); UO.Wait(500); }
                UOItem regs2 = new UOItem(box_regy.AllItems.FindType(NS));
                if (!regs2.Exist) { info("Nenalezeny reg typu 2.. Viz DP. web ... KONEC"); UO.TerminateAll(); }
                regs2.Move(100, World.Player.Backpack);
                info(0x002B, "Doplneni regu 2");
                UO.Wait(300);
            }
          
        }

   

        private void target_box()
        {
            info(0x010C, "Zvol truhlu s bandy");
            box_bandy = new UOItem(UIManager.TargetObject());
            UO.Wait(500);
            if (!box_bandy.Exist)
            {
                info(0x0026, "Truhla s blanky neexistuje nastavuje se BackPack");
                box_bandy = World.Player.Backpack;
            }

            info(0x010C, "Zvol truhlu s regy");
            box_regy = new UOItem(UIManager.TargetObject());
            UO.Wait(500);
            if (!box_regy.Exist)
            {
                info(0x0026, "Truhla s hotovima svitkama neexistuje nastavuje se BackPack");
                box_regy = World.Player.Backpack;
            }
             
        }

        private void piti()
        {
#pragma warning disable
            switch (drink)
            {
                case 1:
                    if (UO.Count(TMR.type, TMR.color) > 0)
                    {
                        vypij(TMR.type, TMR.color, "TMR");
                    }
                    else
                    {
                        if (UO.Count(TMR.Keg_t, TMR.Keg_c) > 0)
                        {
                            nalij(TMR.Keg_t, TMR.Keg_c, "TMR");
                            vypij(TMR.type, TMR.color, "TMR");
                        }
                        else
                        {
                            jak_doplnit_manu();
                        }
                    }
                    break;
                case 2:

                    if (UO.Count(ManaRef.type, ManaRef.color) > 0)
                    {
                        vypij(ManaRef.type, ManaRef.color, "MR");
                    }
                    else
                    {
                        if (UO.Count(ManaRef.Keg_t, ManaRef.Keg_c) > 0)
                        {
                            nalij(ManaRef.Keg_t, ManaRef.Keg_c, "MR");
                            vypij(ManaRef.type, ManaRef.color, "MR");
                        }
                        else
                        {
                            jak_doplnit_manu();
                        }
                    }

                    break;
                default:
                    if (UO.Count(TMR.type, TMR.color) > 0)
                    {
                        vypij(TMR.type, TMR.color, "TMR");
                    }
                    else
                    {
                        if (UO.Count(TMR.Keg_t, TMR.Keg_c) > 0)
                        {
                            nalij(TMR.Keg_t, TMR.Keg_c, "TMR");
                            vypij(TMR.type, TMR.color, "TMR");
                        }
                        else
                        {
                            jak_doplnit_manu();
                        }
                    }
                    break;
            }
#pragma warning restore
        }


        private void jak_doplnit_manu()
        {
#pragma warning disable
            if (zpusob == 2 || zpusob == 3)
            {
                meditace();
            }
            else
            {
                Cekani_intervals("TMR");
            }
#pragma warning restore
        }

        private void vypij(ushort type, ushort color, string name)
        {
            UOItem potion = World.Player.Backpack.AllItems.FindType(type, color);
            potion.Use();
            info(0x0116, "Vypito " + name + " ");
        }

        private void nalij(ushort type, ushort color, string name)
        {
            UOItem keg = World.Player.Backpack.AllItems.FindType(type, color);
            UOItem emptyBottle = World.Player.Backpack.AllItems.FindType(0x0F0E);
            UO.WaitTargetObject(emptyBottle.Serial);
            keg.Use();
            UO.Wait(200);
            info(0x0116, "Nalil jsem " + name + " z kade");
        }

        private void info(string hlaska)
        {
            info(0x00baf, hlaska);
        }

        private void info(ushort color, string hlaska)
        {
            if (print)
            {
                UO.Print(color, "Magery: {0}", hlaska);
            }
        }

        private void Cekani_intervals(string hlaska)
        {
            while (World.Player.Mana <= (min_mana_potrebna + 2))
            {
                UO.Wait(2000);
            }
            info(0x0120, "Mana hranice pro sipku docerpana");
        }

        private void meditace()
        {
            while (World.Player.Mana < World.Player.MaxMana)
            {
                if (!World.Player.Dead)
                {
                    UO.UseSkill("Meditation");
                    UO.Wait(2500);
                     info(0x0120,"Medituju " + World.Player.Mana.ToString() + "/" + World.Player.MaxMana.ToString() + "");
                }
                else { break; }
            }
        }


    }
}
 
Bacon Wrap
30 Jun 2025

Start spinning today on user-friendly slot online platforms with 24/7 support. » slotpg » พีจีสล๊อต » สล็อตแตกง่ายแตกดีในพีจี » ค่ายดังเด่นพีจี

seo
07 Feb 2023

This is really nice to read..informative post is very good to read..thanks a lot!Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!We have sell some products of different custom boxes.it is very useful and very low price please visits this site thanks and please share this post with your friends.I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. สล็อต

seo
07 Feb 2023

Please continue this great work and I look forward to more of your awesome blog posts.I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. pp slot

Nový komentář