Exemplo n.º 1
0
            public static A_Enums.DamageType getNextConventionElement(A_Enums.DamageType CurrentElement, A_Enums.HeroClass Class)
            {
                var class_elements = Presets.ConventionElements.Convention_ClassElements.First(x => x.Key == Class).Value;

                int currentIndex = Array.FindIndex(Presets.ConventionElements.Convention_ElementRotation, x => x == CurrentElement);

                int class_currentindex = Array.FindIndex(class_elements, x => x == CurrentElement);

                if (currentIndex < 0)
                    return DamageType.none;

                if (class_currentindex == class_elements.Count() - 1)
                    return class_elements[0];

                return class_elements[class_currentindex + 1];
            }
Exemplo n.º 2
0
            public static double getConventionTicksLeft(A_Enums.DamageType CurrentElement)
            {
                int currentIndex = Array.FindIndex(Presets.ConventionElements.Convention_ElementRotation, x => x == CurrentElement);

                if (currentIndex < 0)
                    return 0;

                int AttribId_BuffEndTick = Presets.ConventionElements.Convention_BuffEndtickAttribIdRotation[currentIndex];

                double ticksleft = get_BuffTicksLeft(A_Enums.Powers.Convention_PowerSno, AttribId_BuffEndTick);

                return ticksleft;
            }
Exemplo n.º 3
0
        void Draw_NextConvention(UIRect portrait, A_Enums.DamageType element)
        {
            ImageBrush background_next = new ImageBrush(getConventionElement_BitmapImage(element));


            Canvas element_next = new Canvas();
            element_next.Opacity = 0.4;
            element_next.Width = portrait.Width;
            element_next.Height = portrait.Width;
            element_next.Background = background_next;

            Canvas.SetLeft(element_next, portrait.Right + portrait.Width);
            Canvas.SetTop(element_next, portrait.Bottom);

            canvas1.Children.Add(element_next);
        }
Exemplo n.º 4
0
        BitmapImage getConventionElement_BitmapImage(A_Enums.DamageType damagetype)
        {
            switch (damagetype)
            {
                    case DamageType.Arcane:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Arcane_p2-3405442230"));

                    case DamageType.Cold:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Frost_p2-1541236666"));

                    case DamageType.Fire:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Fire_p2-4122635698"));

                    case DamageType.Holy:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Holy_p2-2639019912"));

                    case DamageType.Lightning:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Lightning_p2-569405584"));

                    case DamageType.Physical:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Physical_p2-928374825"));

                    case DamageType.Poison:
                    return new BitmapImage(getResourceUri("Buff_Legendary_Ring_Poison_p2-3513867492"));

                default:
                    return null;
            }
        }
Exemplo n.º 5
0
        public static void PressKey(A_Enums.ActionBarSlot Hotkey, bool ForceMoveCancel = false)
        {
            if (DateTime.Now <= _lastKey.AddMilliseconds(_safeSleep))
                return;

            //-- log action
            if (Properties.Settings.Default.Logger_extendedLog)
                lock (A_Handler.Log.Exception.HandlerLog)
                    A_Handler.Log.Exception.HandlerLog.Add(new LogEntry(DateTime.Now,
                        "Initiating KeyPress for " + Hotkey));
            
            //

            if (Hotkey == A_Enums.ActionBarSlot.RMB)
            {
                IS_Mouse.RightCLick();

                if (ForceMoveCancel)
                    execute_ForceMove();

                _lastKey = DateTime.Now;
                return;

            }

            if (Hotkey == A_Enums.ActionBarSlot.LMB)
            {
                if (!ForceMoveCancel)
                    execute_StandStill_LeftClick();

                else
                    IS_Mouse.LeftClick();

                if (ForceMoveCancel)
                    execute_ForceMove();

                _lastKey = DateTime.Now;
                return;

            }


            switch (Hotkey)
            {
                case A_Enums.ActionBarSlot.Slot1:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1.Value);

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill1 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill1));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill1 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill1));

                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill1.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill1.Value);

                    if (ForceMoveCancel)
                        execute_ForceMove();

                    _lastKey = DateTime.Now;
                    return;

                case A_Enums.ActionBarSlot.Slot2:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2.Value);

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill2 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill2));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill2 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill2));

                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill2.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill2.Value);

                    if (ForceMoveCancel)
                        execute_ForceMove();

                    _lastKey = DateTime.Now;
                    return;

                case A_Enums.ActionBarSlot.Slot3:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3.Value);

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill3 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill3));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill3 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill3));

                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill3.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill3.Value);

                    if (ForceMoveCancel)
                        execute_ForceMove();

                    _lastKey = DateTime.Now;
                    return;

                case A_Enums.ActionBarSlot.Slot4:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4 != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4.Value);

                    if (A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill4 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_ActionBarSkill4));
                    else if (A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill4 != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_ActionBarSkill4));

                    if (A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey1_ActionBarSkill4.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4 != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey2_ActionBarSkill4.Value);

                    if (ForceMoveCancel)
                        execute_ForceMove();

                    _lastKey = DateTime.Now;
                    return;

                case A_Enums.ActionBarSlot.Potion:
                    if (A_Collection.Preferences.Hotkeys.ModKey1_Potion != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey1_Potion.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_Potion != null)
                        PressModKey(A_Collection.Preferences.Hotkeys.ModKey2_Potion.Value);

                    if (A_Collection.Preferences.Hotkeys.Key1_Potion != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key1_Potion));
                    else if (A_Collection.Preferences.Hotkeys.Key2_Potion != Key.Undefined)
                        PressKey(convert_KeyToVirtualKeyCode(A_Collection.Preferences.Hotkeys.Key2_Potion));

                    if (A_Collection.Preferences.Hotkeys.ModKey1_Potion != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey1_Potion.Value);
                    else if (A_Collection.Preferences.Hotkeys.ModKey2_Potion != null)
                        ReleaseModKey(A_Collection.Preferences.Hotkeys.ModKey2_Potion.Value);

                    _lastKey = DateTime.Now;
                    return;
            }

        }
Exemplo n.º 6
0
        void Draw_CurrentConvention(UIRect portrait, A_Enums.DamageType element, double _ticksleft)
        {
            ImageBrush background_current = new ImageBrush(getConventionElement_BitmapImage(element));

            Canvas element_current = new Canvas();
            element_current.Width = portrait.Width;
            element_current.Height = portrait.Width;
            element_current.Background = background_current;

            Canvas.SetLeft(element_current, portrait.Right);
            Canvas.SetTop(element_current, portrait.Bottom);

            //--

            //TextBlock ticksleft_bg = new TextBlock();
            //ticksleft_bg.FontFamily = new FontFamily("Arial Black");
            //ticksleft_bg.Text = (_ticksleft / 60).ToString("0");
            //ticksleft_bg.Foreground = new SolidColorBrush(Colors.Black);
            //ticksleft_bg.Background = new SolidColorBrush(Colors.Transparent);
            //ticksleft_bg.FontSize = FontSize * 2.2;

            //Canvas.SetTop(ticksleft_bg, (portrait.Width / 2) * 40 / 100);
            //Canvas.SetLeft(ticksleft_bg, (portrait.Width / 2) * 50 / 100);
            //element_current.Children.Add(ticksleft_bg);

            //--

            TextBlock ticksleft = new TextBlock();
            ticksleft.FontFamily = new FontFamily("Arial Black");
            ticksleft.Text = (_ticksleft / 60).ToString("0");
            ticksleft.Foreground = new SolidColorBrush(Colors.WhiteSmoke);
            ticksleft.Background = new SolidColorBrush(Colors.Transparent);
            ticksleft.FontSize = FontSize * 1.5;
            
            Canvas.SetTop(ticksleft, (portrait.Width / 2) * 65 / 100);
            Canvas.SetLeft(ticksleft, (portrait.Width / 2) * 65 / 100);
            element_current.Children.Add(ticksleft);
            
            //--
            canvas1.Children.Add(element_current);
        }
Exemplo n.º 7
0
        public static object send_Instruction(A_Enums.TCPInstructions Instruction, string Data)
        {
            try
            {
                using (var tcpclnt = new TcpClient())
                {
                    tcpclnt.SendTimeout = 5000;
                    tcpclnt.ReceiveTimeout = 5000;

                    tcpclnt.Connect(ServerAdrdress, ServerPort);
                    
                    while (!tcpclnt.Connected)
                        System.Threading.Thread.Sleep(10);

                    String instruction = "";

                    switch (Instruction)
                    {
                        case A_Enums.TCPInstructions.ValidateBTag:
                            instruction = "1-$" + Data + "$";
                            break;

                        case A_Enums.TCPInstructions.ValidateClanTag:
                            instruction = "2-$" + Data + "$";
                            break;

                        case A_Enums.TCPInstructions.WriteLogEntry:
                            instruction = "3-$" + Data + "$";
                            break;

                        case A_Enums.TCPInstructions.GetLatestVersion:
                            instruction = "4-$$";
                            break;

                        case A_Enums.TCPInstructions.WriteBugReport:
                            instruction = "5-$" + Data + "$";
                            break;

                        case A_Enums.TCPInstructions.WriteSuggestionsReport:
                            instruction = "6-$" + Data + "$";
                            break;

                        case A_Enums.TCPInstructions.GetTotalUniqueUsers:
                            instruction = "7-$$";
                            break;

                        case A_Enums.TCPInstructions.GetActiveUsers:
                            instruction = "8-$$";
                            break;

                        case A_Enums.TCPInstructions.GetChangelog:
                            instruction = "9-$$";
                            break;

                        case A_Enums.TCPInstructions.GetBugReports:
                            instruction = "10-$$";
                            break;

                        case A_Enums.TCPInstructions.GetSuggestions:
                            instruction = "11-$$";
                            break;

                        case TCPInstructions.GetPowers:
                            instruction = "12-$$";
                            break;

                        case TCPInstructions.StorePower:
                            instruction = "13-$" + Data + "$";
                            break;

                    }

                    using (var stm = tcpclnt.GetStream())
                    {
                        ASCIIEncoding asen = new ASCIIEncoding();
                        byte[] ba = asen.GetBytes(instruction);
                        

                        stm.Write(ba, 0, ba.Length);

                        byte[] bb = new byte[204800];
                        int k = stm.Read(bb, 0, 204800);

                        int _DataSize = BitConverter.ToInt32(bb, 0);
                        int _Header = BitConverter.ToInt32(bb, 4);

                        //while (k < 4 + 4 + _DataSize)
                        //    System.Threading.Thread.Sleep(5);
                        //while (k < 4 + 4 + _DataSize)
                        //    k = stm.Read(bb, k, 102400);

                        byte[] _Data = new byte[_DataSize];
                        Buffer.BlockCopy(bb, 8, _Data, 0, _DataSize);

                        _ObjectType Type = (_ObjectType)_Header;

                        

                        switch (Type)
                        {
                            case _ObjectType._String:
                                string _String = Encoding.ASCII.GetString(_Data, 0, _Data.Length);
                                return _String as string;
                                

                            case _ObjectType._Int:
                                string _Int = Encoding.ASCII.GetString(_Data, 0, _Data.Length);
								if (_Int == "false")
									return 0;
								if (_Int == "true")
									return 1;
                                return int.Parse(_Int);
                               

                            case _ObjectType._DateTime:
                                string _DateTime = Encoding.ASCII.GetString(_Data, 0, _Data.Length);
                                return DateTime.ParseExact(_DateTime, "yy.MM.d.H", System.Globalization.CultureInfo.InvariantCulture);
                                
                            case _ObjectType._Bool:
                                string _Bool = Encoding.ASCII.GetString(_Data, 0, _Data.Length);
                                return Convert.ToBoolean(_Bool);
                                
                            case _ObjectType.List_string:
                                List<string> list = new List<string>();
                                list = ByteArrayToList(_Data);
                                return list as List<string>;

                            case _ObjectType.None:
                                return null;
                        }
                    }
                }
                return null;
            }
            catch { return null; }
        }
Exemplo n.º 8
0
        public static void ChannelKey_Start(A_Enums.ActionBarSlot Hotkey, int ChannelTicks)
        {
            var AllKeys = getKeys_ActionBarSlot(Hotkey);

            if (ChannelTicks > 0)
                ChannelTicks = (int)((1000/60)*ChannelTicks);

            foreach (var Key in AllKeys)
                {
                    if (KeyChannelCache.ContainsKey(Key))
                    {
                        if (ChannelTicks == -1)
                            KeyChannelCache[Key].Stop = DateTime.Now.AddMilliseconds(1);
                        else
                        {
                        KeyChannelCache[Key].Stop = DateTime.Now.AddMilliseconds(ChannelTicks);
                    }
                    }

                    else
                    {
                        if (ChannelTicks == -1)
                            KeyChannelCache.Add(Key, new ChannelDuration(DateTime.Now, DateTime.Now.AddMilliseconds(1), 1));
                        else
                        {
                            KeyChannelCache.Add(Key,
                                new ChannelDuration(DateTime.Now, DateTime.Now.AddMilliseconds(ChannelTicks), ChannelTicks));
                        }

                    }
                }

            

        }
Exemplo n.º 9
0
 public ExceptionLogEntry(System.Exception e, DateTime timestamp, A_Enums.ExceptionThread exceptionthread)
 {
     this.E = e;
     this.Timestamp = timestamp;
     this.ExceptionThread = exceptionthread;
 }
Exemplo n.º 10
0
            public static double getConventionTicksLeft(A_Enums.DamageType CurrentElement, ActorCommonData acd)
            {
                acd.TakeSnapshot();

                int currentIndex = Array.FindIndex(A_Collection.Presets.ConventionElements.Convention_ElementRotation, x => x == CurrentElement);

                if (currentIndex < 0)
                    return 0;

                int AttribId_BuffEndTick = A_Collection.Presets.ConventionElements.Convention_BuffEndtickAttribIdRotation[currentIndex];

                double ticksleft = getBuffCount(A_Enums.Powers.Convention_PowerSno, AttribId_BuffEndTick, acd) - A_Collection.Environment.Scene.GameTick;

                acd.FreeSnapshot();

                return ticksleft;
            }
Exemplo n.º 11
0
        public static void addExceptionLogEntry(System.Exception e, A_Enums.ExceptionThread exceptionthread)
        {
            A_Handler.Log.ExceptionLogEntry newEntry = new A_Handler.Log.ExceptionLogEntry(e, DateTime.Now, exceptionthread);

            lock (A_Handler.Log.Exception.ExceptionLog) A_Handler.Log.Exception.ExceptionLog.Add(newEntry);
        }
Exemplo n.º 12
0
 public static void addExceptionLogEntry(System.Exception e, A_Enums.ExceptionThread exceptionthread)
 {
     ExceptionLogEntry.addExceptionLogEntry(e, exceptionthread);
 }
Exemplo n.º 13
0
        public static void ChannelKey_Stop(A_Enums.ActionBarSlot Hotkey)
        {
            var AllKeys = getKeys_ActionBarSlot(Hotkey);

            foreach (var Key in AllKeys)
            {
                if (KeyChannelCache.ContainsKey(Key))
                {
                    KeyChannelCache.Remove(Key);

                    if (Key == VirtualKeyCode.LBUTTON)
                    {
                        IS_Mouse.LeftUp(0, 0);
                        continue;
                    }

                    if (Key == VirtualKeyCode.RBUTTON)
                    {
                        IS_Mouse.RightUp(0, 0);
                        continue;
                    }

                    WindowsInput.InputSimulator.SimulateKeyUp(Key);
                }
                
            }


        }