Пример #1
0
 internal static void LoginAutostart()
 {
     if (!Status())
     {
         m_autostart.Start();
     }
 }
Пример #2
0
 private static void BuffIcons_Added(BuffIcon buffID, BuffInfo buff)
 {
     if (buffID == BuffIcon.GiftOfLife && buff.Duration > 15)
     {
         if (timer != null)
             timer.Stop();
         timer = Timer.DelayedCallback(TimeSpan.FromSeconds(buff.Duration - 15), OnTimer);
         timer.Start();
     }
 }
Пример #3
0
        public static bool Record( int fps, double sizeFactor )
        {
            IntPtr hBmp = ClientCommunication.CaptureScreen( false, "" );
            using ( Bitmap bmp = Bitmap.FromHbitmap( hBmp ) )
            {
                m_ResX = (int)(bmp.Width * sizeFactor);
                m_ResY = (int)(bmp.Height * sizeFactor);
            }
            DeleteObject( hBmp );

            string filename;
            string name = "Unknown";
            string path = Config.GetString( "RecFolder" );

            if ( World.Player != null )
                name = World.Player.Name;
            if ( name == null || name.Trim() == "" || name.IndexOfAny( Path.GetInvalidPathChars() ) != -1 )
                name = "Unknown";

            name = String.Format( "{0}_{1}", name, DateTime.Now.ToString( "M-d_HH.mm" ) );
            Engine.EnsureDirectory( path );
            int count  = 0;
            do
            {
                filename = Path.Combine( path, String.Format( "{0}{1}.avi", name, count != 0 ? count.ToString() : ""  ) );
                count--; // cause a - to be put in front of the number
            }
            while ( File.Exists( filename ) );

            m_Avi = new AVIFile();
            if ( !m_Avi.Open( filename, fps, m_ResX, m_ResY ) )
                return false;

            UpdateFlip();

            m_RecTimer = new RecordTimer( fps );
            m_RecTimer.Start();

            return true;
        }
Пример #4
0
        private void Cast()
        {
            if (Config.GetBool("SpellUnequip") && Client.Instance.AllowBit(FeatureBit.UnequipBeforeCast))
            {
                Item pack = World.Player.Backpack;
                if (pack != null)
                {
                    // dont worry about uneqipping RuneBooks or SpellBooks
                    Item item = World.Player.GetItemOnLayer(Layer.RightHand);
#if DEBUG
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA &&
                        !item.IsVirtueShield)
#else
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA)
#endif
                    {
                        DragDropManager.Drag(item, item.Amount);
                        DragDropManager.Drop(item, pack);
                    }

                    item = World.Player.GetItemOnLayer(Layer.LeftHand);
#if DEBUG
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA &&
                        !item.IsVirtueShield)
#else
                    if (item != null && item.ItemID != 0x22C5 && item.ItemID != 0xE3B && item.ItemID != 0xEFA)
#endif
                    {
                        DragDropManager.Drag(item, item.Amount);
                        DragDropManager.Drop(item, pack);
                    }
                }
            }

            for (int i = 0; i < Counter.List.Count; i++)
            {
                ((Counter)Counter.List[i]).Flag = false;
            }

            if (Config.GetBool("HighlightReagents"))
            {
                for (int r = 0; r < Reagents.Length; r++)
                {
                    for (int i = 0; i < Counter.List.Count; i++)
                    {
                        Counter c = (Counter)Counter.List[i];
                        if (c.Enabled && c.Format.ToLower() == Reagents[r])
                        {
                            c.Flag = true;
                            break;
                        }
                    }
                }

                if (m_UnflagTimer != null)
                {
                    m_UnflagTimer.Stop();
                }
                else
                {
                    m_UnflagTimer = new UnflagTimer();
                }
                m_UnflagTimer.Start();
            }

            Client.Instance.RequestTitlebarUpdate();
            UOAssist.PostSpellCast(this.Number);

            if (World.Player != null)
            {
                World.Player.LastSpell  = GetID();
                LastCastTime            = DateTime.UtcNow;
                Targeting.SpellTargetID = 0;
            }
        }