示例#1
0
 public override void Run()
 {
     WoWScript.ExecuteNoResults("Dismount()");
     Gatherer.HarvestTarget.Interact();
     Engine.DelayNextPulse(Globals.SleepTime); // Let's give ourself about 1,5 seconds to harvest this node
     Globals.Harvests++;
 }
示例#2
0
        public override void Run()
        {
            CurrentLootable = Lootables.FirstOrDefault() ?? WoWUnit.Invalid;

            if (CurrentLootable != null && CurrentLootable.IsValid)
            {
                if (CurrentLootable.Distance > 4f)
                {
                    if (!Moving || !Manager.LocalPlayer.IsClickMoving)
                    {
                        Moving = true;
                        _parent.Print("Moving to loot {0}", CurrentLootable.Name);
                        Mover.MoveTo(CurrentLootable.Location);
                    }
                    _parent.FSM.DelayNextPulse(500);
                }
                else
                {
                    Moving = false;
                    CurrentLootable.Interact();
                    if (Manager.LocalPlayer.IsLooting)
                    {
                        WoWScript.ExecuteNoResults(
                            "local res = GetCVar(\"AutoLootDefault\") if res == \"0\" then for i = GetNumLootItems(), 1, -1 do LootSlot(i) end end CloseLoot()");
                    }
                    _parent.FSM.DelayNextPulse(2000);
                }
            }
        }
示例#3
0
 public void Learn(int count = 1)
 {
     for (int i = 0; i < count; i++)
     {
         WoWScript.ExecuteNoResults("LearnTalent(" + Tab + ", " + Index + ")");
     }
 }
示例#4
0
        private int DanceCommand(string cmd, string args)
        {
            Manager.Console.Write("Let's dance!", WoWConsoleColor.Highlight);
            WoWScript.ExecuteNoResults("DoEmote(\"dance\")");

            return(1);
        }
示例#5
0
        private void EquipItem(WoWItem item, EquipSlot slot)
        {
            int bi, bs;

            item.GetSlotIndexes(out bi, out bs);
            WoWScript.ExecuteNoResults(string.Format("ClearCursor(); PickupContainerItem({0}, {1}); EquipCursorItem({2})", bi, bs, (int)slot));
        }
示例#6
0
        public override void Run()
        {
            CurrentLootable = Lootables.FirstOrDefault() ?? WoWUnit.Invalid;

            if (CurrentLootable != null && CurrentLootable.IsValid)
            {
                if (CurrentLootable.Distance > 4f)
                {
                    if (Mover.Status != MovementStatus.Moving || Mover.Destination != CurrentLootable.Location)
                    {
                        _parent.Print("Moving to loot {0}", CurrentLootable.Name);
                        if (!Mover.PathTo(CurrentLootable.Location))
                        {
                            _parent.Blacklisted.Add(CurrentLootable.Guid);
                        }
                    }
                    _parent.FSM.DelayNextPulse(500);
                }
                else
                {
                    CurrentLootable.Interact();
                    if (Manager.LocalPlayer.IsLooting)
                    {
                        WoWScript.ExecuteNoResults(
                            "local res = GetCVar(\"AutoLootDefault\") if res == \"0\" then for i = GetNumLootItems(), 1, -1 do LootSlot(i) end end CloseLoot()");
                    }
                    _parent.FSM.DelayNextPulse(2000);
                }
            }
        }
示例#7
0
 public override void OnStart()
 {
     WoWScript.ExecuteNoResults("SetWhoToUI(1)");
     Events.Register("WHO_LIST_UPDATE", HandleEvent);
     TotalSearches      = 0;
     CurrentLevelSearch = 1;
     CurrentState       = GRState.Search;
 }
示例#8
0
 public void BuyAllAvailable()
 {
     WoWScript.ExecuteNoResults("SetTrainerServiceTypeFilter(\"available\", 1)");
     foreach (TrainerService s in Services.Where(x => x.Available))
     {
         s.Buy();
     }
 }
示例#9
0
 public void SelectGameAccount(string account)
 {
     WoWScript.ExecuteNoResults(
         string.Format(
             "for i = 0, GetNumGameAccounts(), 1 do local name = GetGameAccountInfo(i) " +
             "if (name == '{0}') then SetGameAccount(i) end end",
             account));
 }
示例#10
0
 public void Buy(int quantity)
 {
     while (quantity > 0)
     {
         int amount = (quantity > MaxStack ? MaxStack : quantity);
         WoWScript.ExecuteNoResults("BuyMerchantItem(" + Index + ", " + amount + ")");
         quantity -= amount;
     }
 }
示例#11
0
 public void SelectCharacter(string character)
 {
     if (CharSelectVisible)
     {
         WoWScript.ExecuteNoResults(
             string.Format(
                 "for i=0,GetNumCharacters(),1 do local name = GetCharacterInfo(i)" +
                 "if (name ~= nil and name == '{0}') then CharacterSelect_SelectCharacter(i) end end",
                 character));
     }
 }
示例#12
0
 public void SetFilter(bool available = true, bool?unavailable = false, bool?used = false)
 {
     WoWScript.ExecuteNoResults(string.Format("SetTrainerServiceTypeFilter(\"available\", {0})", available ? 1 : 0));
     if (unavailable.HasValue)
     {
         WoWScript.ExecuteNoResults(string.Format("SetTrainerServiceTypeFilter(\"unavailable\", {0})", unavailable.Value ? 1 : 0));
     }
     if (used.HasValue)
     {
         WoWScript.ExecuteNoResults(string.Format("SetTrainerServiceTypeFilter(\"used\", {0})", used.Value ? 1 : 0));
     }
 }
        public override void OnStart()
        {
            if (!Manager.ObjectManager.IsInGame)
            {
                return;
            }

            WoWScript.ExecuteNoResults("SetWhoToUI(1)");
            Manager.Events.Register("WHO_LIST_UPDATE", HandleEvent);
            TotalSearches      = 0;
            CurrentLevelSearch = 1;
            CurrentState       = GRState.Search;
        }
示例#14
0
        public override void OnStart()
        {
            if (!Manager.ObjectManager.IsInGame)
            {
                return;
            }

            //Print("Facing: {0}", Manager.LocalPlayer.Facing);
            foreach (var p in Manager.ObjectManager.Objects.Where(x => x.IsPlayer).Cast <WoWPlayer>())
            {
                Print("-- {0}", p.Name);
                Print("\tGUID: 0x{0}", p.Guid.ToString("X8"));
                Print("\tPosition: {0}", p.Location);
            }

            //foreach (var obj in Manager.ObjectManager.Objects.Where(x => x.IsUnit).Cast<WoWUnit>())
            //{
            //    if (obj.IsHostile)
            //    {
            //        Print("-- {0}", obj.Name);
            //        Print("\tGUID: 0x{0}", obj.Guid.ToString("0"));
            //        Print("\tPosition: {0}", obj.Location);
            //    }
            //}

            List <WoWUnit> _list = new List <WoWUnit>(GetClosestAttackables());

            if (_list.Count > 0)
            {
                foreach (var obj in _list)
                {
                    Print("-- {0}", obj.Name);
                    Print("\tGUID: 0x{0}", obj.Guid.ToString("0"));
                    Print("\tPosition: {0}", obj.Location);
                    Print("\tDistance: {0}", obj.Distance);
                    Manager.Movement.PathTo(obj.Location);

                    //while (obj.Distance > 5)
                    //    Thread.Sleep(100);

                    Print("\tExecute Facing:");
                    obj.Face();

                    Print("\tExecute Interact:");
                    obj.Interact();

                    Print("\tExecute Attack:");
                    WoWScript.ExecuteNoResults("/startattack");
                }
            }
        }
示例#15
0
 public override void OnTick()
 {
     if (Leader.IsValid)
     {
         if (Helper.InCombat)
         {
             if (FollowingLeader)
             {
                 WoWScript.ExecuteNoResults("MoveForwardStop()");
                 FollowingLeader = false;
             }
             if (Leader.IsCasting && !Manager.LocalPlayer.IsCasting)
             {
                 var id = Leader.CastingId;
                 if (id == 0)
                 {
                     id = Leader.ChanneledCastingId;
                 }
                 var spell = WoWSpell.GetSpell(id);
                 if (spell.IsValid)
                 {
                     var target = Leader.Target;
                     if (target.IsValid)
                     {
                         if (Manager.LocalPlayer.Target != target)
                         {
                             target.Select();
                         }
                         spell.Cast(target as WoWUnit);
                         Print("Casting {0} on {1}", spell.Name, target.Name);
                     }
                     else
                     {
                         spell.Cast(Manager.LocalPlayer);
                         Print("Casting {0} on self", spell.Name);
                     }
                 }
             }
         }
         else
         {
             if (!FollowingLeader)
             {
                 Leader.Select();
                 WoWScript.ExecuteNoResults("FollowUnit(\"target\")");
                 FollowingLeader = true;
             }
         }
     }
 }
示例#16
0
 public override void Run()
 {
     if (_parent.Leader.Distance > 8)
     {
         if (Manager.LocalPlayer.IsClickMoving)
         {
             return;
         }
         Manager.LocalPlayer.ClickToMove(_parent.Leader.Location);
         _parent.FSM.DelayNextPulse(200);
         return;
     }
     _parent.Leader.Select();
     WoWScript.ExecuteNoResults("FollowUnit(\"target\")");
     _parent.FollowingLeader = true;
 }
示例#17
0
 public void SelectRealm(string realm)
 {
     if (RealmFrameVisible)
     {
         var curRealm = WoWScript.Execute <string>("GetServerName()");
         if (!string.IsNullOrEmpty(curRealm) && curRealm == realm)
         {
             WoWScript.ExecuteNoResults(
                 string.Format(
                     "for i = 1, select('#', GetRealmCategories()), 1 do local numRealms = GetNumRealms(i)" +
                     "for j = 1, numRealms, 1 do local name, numCharacters = GetRealmInfo(i, j)" +
                     "if (name ~= nil and name == '{0}') RealmList:Hide() ChangeRealm(i,j) end end end",
                     realm));
         }
         else
         {
             WoWScript.ExecuteNoResults("RequestRealmList(1)");
         }
     }
 }
示例#18
0
        private void ResetFilter()
        {
            if (!IsOpen)
            {
                return;
            }

            WoWScript.ExecuteNoResults(
                "TradeSkillOnlyShowMakeable(false)" +
                "TradeSkillOnlyShowSkillUps(false)" +
                "SetTradeSkillSubClassFilter(0)" +
                "SetTradeSkillInvSlotFilter(0)" +
                "SetTradeSkillItemNameFilter(\"\")"
                ); // No filters!

            for (int i = 1; i <= WoWScript.Execute <int>("GetNumTradeSkills()"); i++)
            {
                WoWScript.ExecuteNoResults("ExpandTradeSkillSubClass(" + i + ")");
            }
        }
示例#19
0
        private void HandleEvent(string ev, List <string> args)
        {
            switch (ev)
            {
            case "START_LOOT_ROLL":
                EvaluateRollItem(Convert.ToInt32(args.ElementAtOrDefault(0)));
                break;

            case "CONFIRM_DISENCHANT_ROLL":
            case "CONFIRM_LOOT_ROLL":
                WoWScript.ExecuteNoResults("ConfirmLootRoll(" + args.ElementAtOrDefault(0) + "," + args.ElementAtOrDefault(1) + ")");
                break;

            case "LOOT_BIND_CONFIRM":
                WoWScript.ExecuteNoResults("ConfirmLootSlot(" + args.ElementAtOrDefault(0) + ")");
                break;

            case "USE_BIND_CONFIRM":
                WoWScript.ExecuteNoResults("ConfirmBindOnUse()");
                break;

            case "EQUIP_BIND_CONFIRM":
            case "AUTOEQUIP_BIND_CONFIRM":
                WoWScript.ExecuteNoResults("EquipPendingItem(" + args.ElementAtOrDefault(0) + ")");
                break;

            case "ITEM_PUSH":
                // New item in inventory.
                _lastPulse = DateTime.MinValue;
                break;

            case "ACTIVE_TALENT_GROUP_CHANGED":
            case "CHARACTER_POINTS_CHANGED":
            case "PLAYER_ENTERING_WORLD":
                // Update weightsets
                break;
            }
        }
示例#20
0
 public static void RejectDungeon()
 {
     WoWScript.ExecuteNoResults("RejectProposal()");
 }
示例#21
0
 private void RollItem(int rollId, RollType type)
 {
     WoWScript.ExecuteNoResults("RollOnLoot(" + rollId + "," + (int)type + ")");
 }
示例#22
0
 public static void Hide(string frameName)
 {
     WoWScript.ExecuteNoResults(frameName + ":Hide()");
 }
示例#23
0
 public void Summon()
 {
     WoWScript.ExecuteNoResults("CallCompanion(\"MOUNT\", " + Index + ")");
 }
示例#24
0
 public void UseItem(int slot)
 {
     WoWScript.ExecuteNoResults("UseContainerItem(" + Id + ", " + slot + ")");
 }
示例#25
0
 public static void AcceptDungeon()
 {
     WoWScript.ExecuteNoResults("AcceptProposal()");
 }
示例#26
0
 public static void LeaveQueue()
 {
     WoWScript.ExecuteNoResults("LeaveLFG()");
 }
示例#27
0
 public static void RepairAll()
 {
     WoWScript.ExecuteNoResults("RepairAllItems()");
 }
示例#28
0
 public static void JoinQueue()
 {
     WoWScript.ExecuteNoResults("LFDQueueFrame_Join()");
 }
示例#29
0
 public override void Run()
 {
     Mover.StopMoving();
     WoWScript.ExecuteNoResults("RetrieveCorpse()");
 }
示例#30
0
        public override void OnTick()
        {
            switch (CurrentState)
            {
            case GRState.Search:
                Print("Starting a new search for level {0}", CurrentLevelSearch);
                LastSearch = DateTime.Now;
                WoWScript.ExecuteNoResults("SendWho(\"" + CurrentLevelSearch + "\")");
                TotalSearches++;

                CurrentState = GRState.Searching;
                break;

            case GRState.Searching:
                var span = DateTime.Now - LastSearch;
                if (span.TotalSeconds > 5)
                {
                    Print("Last search didn't give any match after 5 seconds, maybe there are no characters in this level?");
                    CurrentLevelSearch++;
                    CurrentState = GRState.Search;
                }
                break;

            case GRState.Invite:
                var searchResult = WoWScript.Execute("GetNumWhoResults()");
                var shownResults = int.Parse(searchResult[0]);
                var totalResults = int.Parse(searchResult[1]);
                Print("Search returned {0} visible matches out of a total {1}", shownResults, totalResults);
                for (int i = 1; i <= shownResults; i++)
                {
                    var searchInfo = WoWScript.Execute("GetWhoInfo(" + i + ")");
                    var charInfo   = new Character()
                    {
                        Name  = searchInfo[0],
                        Guild = searchInfo[1],
                        Level = int.Parse(searchInfo[2]),
                        Race  = searchInfo[3],
                        Class = searchInfo[4],
                        Zone  = searchInfo[5]
                    };

                    if (string.IsNullOrEmpty(charInfo.Guild) && !InvitedCharacters.ContainsKey(charInfo.Name))
                    {
                        Print("Inviting {0} (Level {1} {2} {3})", charInfo.Name, charInfo.Level, charInfo.Race, charInfo.Class);
                        WoWScript.ExecuteNoResults("SendChatMessage(\"" + RecruitMessage + "\", \"WHISPER\", nil, \"" + charInfo.Name + "\")");
                        WoWScript.ExecuteNoResults("GuildInvite(\"" + charInfo.Name + "\")");
                        InvitedCharacters.Add(charInfo.Name, charInfo);
                    }
                }

                CurrentState = GRState.Search;
                Sleep(5000);
                break;

            case GRState.Completed:
                Print("Stopping after {0} searches and {1} invites", TotalSearches, InvitedCharacters.Count);
                Stop();
                break;
            }

            Sleep(500);
        }