Jump to content

scsfl

Members
  • Posts

    30
  • Joined

  • Last visited

Everything posted by scsfl

  1. hello community! I'm trying to implement following method in druid FC: when condition met bot has to use flying mount, else ground mount. There is following logic: I'm subscribing to OnPathFinderFindPath event and checking if I need to use flying path to destination point. If so then I'm setting destination flying and calling LongMove.LongMoveGo(destination). private static void checkIfNeedFlyingPath(Vector3 from, Vector3 to, string continentNameMpq, CancelEventArgs cancelable) { if (NeedToUseFlyingPath(to)) { to.SetFlying(); UseFlightForm(); Logging.WriteNavigator($"LongMove to {to}"); LongMove.LongMoveGo(to); cancelable.Cancel = true; } } Function that check if I need to fly. private static bool NeedToUseFlyingPath(Vector3 dest) { RotationLogger.Debug($"Calling NeedToUseFlyingPath({dest})"); if (!FlightForm.IsKnown() || Me.IsDead || Me.IsSwimming || Usefuls.ContinentNameMpq == "Azeroth") { RotationLogger.Debug($"NeedToUseFlyingPath() precondition failed!"); return false; } float dist = Me.Position.DistanceTo(dest); RotationLogger.Debug($"[Movement] Distance to point {dist}"); if (dist >= FCSettings.CurrentSetting.MinDistanceToFly && (Logging.Status == "To Town" || Logging.Status == "Farming" || Logging.Status == "Looting" || ToTown.GoToTownInProgress || dist >= FCSettings.CurrentSetting.DistanceToFly)) { RotationLogger.Debug($"[Movement] Need to use flying path to {dest}"); return true; } RotationLogger.Debug($"[Movement] Need to use ground path to {dest}"); return false; } The problem that this method is not stable. Sometimes it works fine, sometimes especially after farming state bot literally walks by the ground in flying form, then he might continue flying. I couldn't get where does he get this ground points when there is LongMove between 2 points 🙂 When I use built-in flying mechanics everything works decent. But I don't know how to implement similar flight mechanics.
  2. Thank you @Matenia. Very helpful template with useful class. Helped me to make a weekly quester with grinder rotation depending on a day of the week.
  3. You have to modify ur fightclass. public void Initialize() { FightEvents.OnFightLoop += TargetSwitcher; } public void Dispose() { FightEvents.OnFightLoop -= TargetSwitcher; } private void TargetSwitcher(WoWUnit woWPlayer, System.ComponentModel.CancelEventArgs cancelable) { WoWPlayer player = ObjectManager.GetNearestWoWPlayer(ObjectManager.GetObjectWoWPlayer().Where(o => o.IsAttackable).ToList()); if (player == null || !player.IsValid || !player.IsAlive || player.Faction == ObjectManager.Me.Faction || player.IsFlying || player.IsMyTarget || woWPlayer.Guid == player.Guid) return; if (player.InCombatWithMe && ObjectManager.Target.Type != WoWObjectType.Player) { cancelable.Cancel = true; Fight.StartFight(player.Guid, robotManager.Products.Products.ProductName != "WRotation", false); } }
  4. @Matenia has shared an example containing method you're looking for.
  5. Brilliant advice man! I'm very appreciating your help. var luaString = @" function OnEvent(self, event) local args = { } eventInfo = {CombatLogGetCurrentEventInfo()} for key, value in pairs(eventInfo) do table.insert(args, tostring(value)) end _G.args = (table.concat(args, ',')) end print ('frame works') f = CreateFrame('Frame') f: SetAttribute(name, 'CLEU') f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') f: SetScript('OnEvent', OnEvent)"; Now I'm able to access _G.args from OnEventsLuaStringWithArgs ?. Thanks ?
  6. Can I ask one more dumb question please. Ok I did lua string that initialize lua frame and I'm able to store the payload in table each time event fired. luaString = @" local function OnEvent(self, event) local args = { } eventInfo = {CombatLogGetCurrentEventInfo()} for key, value in pairs(eventInfo) do table.insert(args, tostring(value)) end args = (table.concat(args, ',')) print (args) --debug end local f = CreateFrame('Frame') f: SetAttribute(name, 'CLEU') f: RegisterEvent('COMBAT_LOG_EVENT_UNFILTERED') f: SetScript('OnEvent', OnEvent)"; Also I've got a C# function that which takes CLEU args as parameter. Is there way to call this function inside luaString? In other words I need to send args to a function every time event fired. The only thing comes in mind is to create chat frame inside lua string, sent CLEU args to this frame and read this frame using EventsLuaWithArgs.OnEventsLuaStringWithArgs. But It looks awful ?
  7. Hi there! Does anybody know Is there way to make fight class listen to Lua events? Especially COMBAT_LOG_EVENT_UNFILTERED. Yeah I know there is EventsLuaWithArgs.OnEventsLuaStringWithArgs but it pretty often skips COMBAT_LOG_EVENT_UNFILTERED and even when it fires it doesn't return any args cuz I have to use CombatLogGetCurrentEventInfo() function to get a payload. How can I subscribe COMBAT_LOG_EVENT_UNFILTERED with args using c#? Thank you.
  8. This options is not about determinating which rotation spells should be casted or skipped. As Droidz said earlier with that options your next rotation spell tries to launch before it can be used and that is why in some cases this spell could be skipped. If you want your rotation to work as you intend I do not recommend to use this option.
  9. Most advanced and fundamental fight class sample I've ever seen. Awesome work. The only moment I still didn't get is wanding. Sometimes while wanding the bot is something like can't change rotation step. I mean for example i've got 10 steps in my rotation. Wanding has lowest priority. And if all conditions is fit for wanding he starts shoot. Everything is fine, but if he starts wanding, rotation step is not changing until I manually interrupt hes wanding process by pressing any movement key. Right after that rotation is working again as it should and bot continues rotate steps. Even other rotations spells with "force" enabled doesn't work. This problem happens only when bot is wanding. For other spells everything is good. My conditions for wanding: new RotationStep(new RotationSpell("Shoot"), 10f, (s, t) => MeHaveWand() && !RotationCombatUtil.IsAutoShooting() && !Me.GetMove, RotationCombatUtil.BotTarget), private static bool MeHaveWand() { return ObjectManager.Me.GetEquipedItemBySlot(InventorySlot.INVSLOT_RANGED) != 0 ? true : false; } public static bool IsAutoShooting() { return Lua.LuaDoString<bool>("return IsAutoRepeatSpell('Shoot')"); } Maybe some problems with spell verification. Wow vanilla.
  10. Hi. Try this. Returns a dictionary where key is itemname and value is lowest price. private static Dictionary<string, int> GetLowestItemPrice() { Dictionary<string, int> CheapestItems = new Dictionary<string, int>(); List<AuctionHelpers.AuctionItem> ItemsList = new List<AuctionHelpers.AuctionItem>(); List<string> ItemsToCheck = /*your list of items*/ int LowestPrice = 0; if (AuctionHelpers.AuctionHouseIsShown()) foreach (string item in ItemsToCheck) { AuctionHelpers.BrowseNameSetText(item); Thread.Sleep(2000); AuctionHelpers.IsUsableCheckButtonSetChecked(false); if (AuctionHelpers.BrowseSearchButtonIsEnabled()) { AuctionHelpers.BrowseSearchButtonClick(); Thread.Sleep(2000); while (AuctionHelpers.BrowseNextPageButtonIsEnabled()) { if (AuctionHelpers.GetBrowsePageItems().Any()) { ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems()); AuctionHelpers.BrowseNextPageButtonClick(); Thread.Sleep(1000); } } if (AuctionHelpers.GetBrowsePageItems().Any()) ItemsList.AddRange(AuctionHelpers.GetBrowsePageItems()); ItemsList.RemoveAll(i => (i.Name != item) || (i.BuyoutPricePerUnit == 0)); LowestPrice = ItemsList.Min(price => price.BuyoutPricePerUnit); CheapestItems.Add(item, LowestPrice); } } foreach (KeyValuePair<string, int> kvp in CheapestItems) { Logging.Write("Itemname = " + kvp.Key + "Itemprice " + kvp.Value); } AuctionHelpers.CloseAuctionHouse(); return CheapestItems; }
  11. Thanks. But I've already checked wManager lib and I didn't see anything suits my need. Anyway looks like the only method is using lua.
  12. Hi there! Trying to make own AH product. And there is a question. How do I get list of items currently sailing by me? I've tried AuctionHelpers.GetBrowsePageItems() But looks like it only works for "Browse" tab of AH. So i cannot get list of elements when I'm on "Auction" tab. Is there built-in function? Or it could be resolved only by lua?
  13. That's problem. When I click on button "Player/Target Buff/Debuff" I've got following message in debug log "[SpellManager] Cannot found spell: public static SpellInfo SpellInfoCreateCache()". And even I've got buff on me, it doesn't show in dev tools window. It shows everything, except this buff. So I can't check spell id. And the most interesting thing, that this problem appears only with one character. On other heroes everything works fine!
  14. Ok replace your bin\wManager.dll in wrobot folder to attached file and launch bot via relogger. Just temporary solution. wManager.dll
  15. Same here! After last wrobot update it's became broken!
  16. Hi! In my druid fight class I use following condition new SpellState("Savage Roar", 30, context => ObjectManager.Me.GetPowerByPowerType(PowerType.Energy) >= 45 && ObjectManager.Me.ComboPoint >= 3 && !ObjectManager.Me.HaveBuff(52610) && ObjectManager.Me.HaveBuff(3025), false, false, false, false, true, false, false, false, 0, false, false, false, false, false, false, wManager.Wow.Helpers.FightClassCreator.YesNoAuto.Auto, "", "none", true, true, false), But in game it doesn't properly work. The reason is that bot can't properly check this one: !ObjectManager.Me.HaveBuff(52610) He just doesn't see that I've got this buff. When I manually trying to view my buffs via developer tools it doesn't show that I've got "Savage Roar" on me. But in game its active! All another buffs/debuffs shows properly. And every time I'm pushing "show player buff/debuff" button, I've got following error in log: [SpellManager] Cannot found spell: public static SpellInfo SpellInfoCreateCache(). And finally: on my another hero I don't have any issues. This one happens only with one character.
  17. Hi. Tell me please how can I make some action right after specific string appears in general chat? This is not player message, its a string, generated by luascript in some plugin.
  18. One more question. Is there way to detect stuck nodes? Yeah, I know there is an option in wrobot for this, but I need to do it manually in my plugin. Thanks :) update: got it. U have to add following condition !wManager.wManagerSetting.IsBlackListedAllConditions()
  19. Hello Droidz! Tell me please how can I check is there any gatherable or mineable corpse near me? Tried ObjectManager.GetWoWUnitLootable().Where(p => p.GetDistance <= 5).ToList() but its only works for common loot, not for gather herbs or mine ore from corpse. Thanks.
  20. Erm, I don't get, does option "Loot mobs" should be turned ON?
  21. Does anyone know how to setup loot distance? Not search radius in wrobot options, but exactly loot radius. I need it to avoid looting every mob in 300 radius. And if I turn off "Loot mobs" option bot doesn't loot spawned mobs (e.g. withered hungerer).
  22. scsfl

    Farms/Loots counter

    Hello. Every time bot trying to loot mob killed by another player (maybe by himself too), farms counter increased by 1. In this case loot counter should've been increased. Therefore user gets incorrect loot/farm statistic.
  23. Thank you so much! So for felslate it's gonna look something like this: float radius = 50; foreach (var o in ObjectManager.GetObjectWoWGameObject()) { if (o.IsValid && o.GetDistance < radius && o.CanOpen && o.Name == "Felslate Deposit") { // your code here } } Right?
×
×
  • Create New...