Beispiel #1
0
        private string GetEditboxText(string frameName = null)
        {
            WoWUIFrame frame = WoWUIFrame.GetFrameByName(this, frameName ?? "ChatFrame1EditBox");

            if (frame == null)
            {
                log.Error("GetEditboxText: " + (frameName ?? "ChatFrame1EditBox") + " is null");
            }
            return(frame?.EditboxText);
        }
Beispiel #2
0
 private void TimerStaticPopup_OnElapsed()
 {
     foreach (Tuple <string, string> tuple in PopupFrames)
     {
         WoWUIFrame frame = WoWUIFrame.GetFrameByName(game, tuple.Item2);
         if (frame != null && frame.IsVisible)
         {
             this.LogPrint(tuple.Item1 + " is visible!");
             string  message = tuple.Item1 + " is visible!";
             dynamic libSMS  = Utilities.GetReferenceOfPlugin("LibSMS");
             libSMS.SendSMS(message, game);
             this.ShowNotify(message, false, false);
             this.LogPrint("Message is sent: " + message);
             for (int i = 0; i < 60; i++)
             {
                 if (timerStaticPopup.IsRunning)
                 {
                     Thread.Sleep(1000);
                 }
             }
             break;
         }
     }
 }
Beispiel #3
0
        private void ShamanRoutine(WoWPlayerMe me)
        {
            var myEditbox = WoWUIFrame.GetFrameByName(game, frameName);

            //if (myEditbox == null)
            //{
            //    var funcName = Utilities.GetRandomString(6, true);
            //    var commands = new string[] {
            //        $"/run if(not {frameName})then CreateFrame(\"EditBox\", \"{frameName}\", UIParent);{frameName}:SetAutoFocus(false);{frameName}:ClearFocus(); end",
            //        $"/run {funcName}=\"{frameName}:SetText(tostring(GetSpellCooldown(\\\"Удар бури\\\"))..\\\"#\\\"..tostring(GetSpellCooldown(\\\"Камнедробитель\\\"))\"",
            //        $"/run {funcName}={funcName}..\"..\\\"#\\\"..tostring(GetSpellCooldown(\\\"Язык пламени\\\"))..\\\"#\\\"..tostring(UnitPower(\\\"player\\\", 11)))\"",
            //        $"/run C_Timer.NewTicker(.25, function() loadstring({funcName}); end)"
            //    };
            //    foreach (var command in commands)
            //        game.SendToChat(command);
            //}

            if (specialization == 1)
            {
                if (game.LuaGetValue("tostring(UnitDebuff(\"target\", \"Огненный шок\") or \"nil\")") == "nil")
                {
                    game.CastSpellByName("Огненный шок");
                }
                else if (float.Parse(game.LuaGetValue("tostring(select(2, GetSpellCooldown(\"Выброс лавы\")))"), CultureInfo.InvariantCulture) <= 1.5)
                {
                    game.CastSpellByName("Выброс лавы");
                }
                else
                {
                    game.CastSpellByName("Молния");
                }
            }
            else if (specialization == 2)
            {
                myEditbox = WoWUIFrame.GetFrameByName(game, frameName);

                var regex = new Regex("(\\d+)#(\\d+)#(\\d+)#(\\d+)");
                this.LogPrint(myEditbox.EditboxText);
                var match            = regex.Match(myEditbox.EditboxText);
                var stormstrikeHasCd = match.Groups[1].Value != "0";
                var maelstrom        = int.Parse(match.Groups[4].Value);
                var rockbiterHasCd   = match.Groups[2].Value != "0";
                var flameTongueHasCd = match.Groups[3].Value != "0";
                if (!stormstrikeHasCd && maelstrom >= 30)
                {
                    game.CastSpellByName("Удар бури");
                    return;
                }
                if (!rockbiterHasCd)
                {
                    game.CastSpellByName("Камнедробитель");
                    return;
                }
                if (!flameTongueHasCd)
                {
                    game.CastSpellByName("Язык пламени");
                    return;
                }
                if (maelstrom >= 40)
                {
                    game.CastSpellByName("Вскипание лавы");
                }
            }
        }