-
Posts
225 -
Joined
-
Last visited
Content Type
Forums
Articles
Bug Tracker
Downloads
Store
Posts posted by Seminko
-
-
3 minutes ago, Apexx said:
I do believe Seminko did not define unitToAttack.
Simply replace
if (lowestHP != null && unitToAttack.IsValid && unitToAttack.IsAlive && !lowestHP.IsMyTarget) // if the lowest hp mob is valid, alive and NOT your current target
with:
if (lowestHP != null && lowestHP.IsValid && lowestHP.IsAlive && !lowestHP.IsMyTarget) // if the lowest hp mob is valid, alive and NOT your current target
Yea, that is my bad. Was copying stuff from my other FCs :) Let me update the original reply. Thx for correcting me.
-
14 hours ago, Lockem said:
Like the title says...
I'm working on a BM hunter fightclass. I'd like to find a way to make it prioritize low hp enemies when there are multiple aggro'd... I have no idea where to start though.
Thanks,
You need an OnFightLoop fight event.
I'm not sure whether this is the correct way to handle events but it's the way I could come up with, since my knowledge of Csharp is very limited still... BUT, what I do is put the OnFightLoop event in a method and call it during initialization. Once it is called the events "are recognized" and will fire everytime you are in a fight loop.
Disclaimer: this is not tested, put this together just now...
public void TargetSwitcher() // needs to be called just once, ie during Initialize { FightEvents.OnFightLoop += (unit, cancelable) => { // this code will loop everytime you are fighting List<WoWUnit> attackers = ObjectManager.GetUnitAttackPlayer(); // gets all units attacking you if (attackers.Count > 1) // if you are attacked by more than one mob { Logging.WriteDebug("More than 1 attackers detected."); //WoWUnit highestHP = attackers.OrderBy(uo => uo.HealthPercent).LastOrDefault(); // sort the list based on HP from lowest to highest, pick highest WoWUnit lowestHP = attackers.OrderBy(ou => ou.HealthPercent).FirstOrDefault(); // sort the list based on HP from lowest to highest, pick lowest if (lowestHP != null && lowestHP.IsValid && lowestHP.IsAlive && !lowestHP.IsMyTarget) // if the lowest hp mob is valid, alive and NOT your current target { cancelable.Cancel = true; // not TOO sure about this one haha Interact.InteractGameObject(lowestHP.GetBaseAddress); // switch to it Fight.StartFight(lowestHP.GetBaseAddress); // start fighting it Logging.WriteDebug("Switched to lowestHP target."); } } }; }
As a bonus, check this post by Droidz. Might be usefull too.
Let me know how it worked out for ya...
-
On 30. 8. 2014 at 6:49 PM, da8ball said:
I meant to cast the fishing pole faster XD. I dont think the rotation is used since it is just fishing, right ?
this is quite necro, but have you found out?
-
13 minutes ago, Droidz said:
Hello, it is not a bug, items names are server side, you need to have item in your bag (or request item info like when you "GetNameById) for that Wow request the item name at the server ( http://wowwiki.wikia.com/wiki/API_GetItemInfo )
Yea, figured it out with the guys on Discord. Let me update the description.
Thanks for getting back to me
-
I would like to report a bug.I've been working on a project non-stop today only to find out that GetIdByName is unreliable
and apparently bugged.How to reproduce this
bug(tried 4 times in a row and been indeed able to reproduce it):- Close WRobot and open it afresh
- Go to Development Tools
-
Run this code --> it returns 0
var itemID = wManager.Wow.Helpers.ItemsManager.GetIdByName("Pet Rock"); Logging.WriteDebug("[ItemID] " + itemID);
-
Now run this code --> it properly returns "Pet Rock"
var NameID = wManager.Wow.Helpers.ItemsManager.GetNameById(20030); Logging.WriteDebug("[NameID] " + NameID);
- Now run the first code again and it now correctly returns Pet Rock's item id 20030.
Quote[D] 23:43:58 - [ItemID] 0
[D] 23:44:03 - [NameID] Pet Rock
[D] 23:44:07 - [ItemID] 20030Anyone who is reading this, I'd appreciate if you tried reproducing it and report back. Since we don't know if it's related to Vanilla only, any WoW version is fine for now.Thanks
S.
EDIT: tried with Empty Wallet as well... same thing
-
-
Strange thing is I have the same version of WRobot and WoW as Brutus (we checked on mumble) and my bot works properly.
-
7 minutes ago, BetterSister said:
reading combat log?
1) don't know how to do that
2) how would one determine if the thing that killed you was a player just based on a string
-
Is there a way to check what killed me? I'd like the bot to pause for a couple of minutes if a player killed me.
-
10 hours ago, reapler said:
You may check first whether "sRogueSettings.CurrentSetting" is null:
private void FoodManager() { try { if (sRogueSettings.CurrentSetting == null) robotManager.Helpful.Logging.Write("CurrentSetting is null"); else robotManager.Helpful.Logging.Write("CurrentSetting is not null"); } catch (Exception e) { robotManager.Helpful.Logging.WriteError(e.ToString()); } }
You get probably "CurrentSetting is null" ;)
So in this case this means you haven't initialized "CurrentSetting" = no instance to your object is given = "CurrentSetting" is null, hence you cannot accessing its properties.
In the end you need to call "sRogueSettings.Load();" to create an instance.
However If it's not the case, you may check for other variables against null.
I'm stupid... did not have sRogueSettings.Load();
-
1 hour ago, reapler said:
Hello, if something crashes and it's not a stack overflow (recursive call) you may wrap your code in a try-catch statement:
private void FoodManager() { try { if (sRogueSettings.CurrentSetting.UseBuffFood && sRogueSettings.CurrentSetting.BuffFoodName != null && sRogueSettings.CurrentSetting.BuffFoodBuffName != null) { uint foodID = wManager.Wow.Helpers.ItemsManager.GetIdByName(sRogueSettings.CurrentSetting.BuffFoodName); if (!ObjectManager.Me.HaveBuff(sRogueSettings.CurrentSetting.BuffFoodBuffName) && ItemsManager.HasItemById(foodID) && wManagerSetting.CurrentSetting.FoodName != sRogueSettings.CurrentSetting.BuffFoodName) { wManagerSetting.CurrentSetting.FoodName = sRogueSettings.CurrentSetting.BuffFoodName; } else if (ObjectManager.Me.HaveBuff(sRogueSettings.CurrentSetting.BuffFoodBuffName) && wManagerSetting.CurrentSetting.FoodName != originalFoodSetting) { wManagerSetting.CurrentSetting.FoodName = originalFoodSetting; } } } catch (Exception e) { robotManager.Helpful.Logging.WriteError(e.ToString()); } }
I think you have probably a null reference exception on your settings, so you would check for "sRogueSettings.CurrentSetting" whether it is null at first.
And "sRogueSettings.CurrentSetting.BuffFoodName != null" is not necessary on a string, since checking against null will result always in false.
Oh right, didn't think of that, still new and learning :)
Yup, it was "Object reference not set to an instance of an object. in Main.FoodManager()"
However still don't understand the exception. What is out of place? Everything seems to be set up correctly. How do I pinpoint where the error is?
-
I'm at the end of my rope. For some reason this code crashes WRobot. I have it in a while loop. Log included...
private void FoodManager() { if (sRogueSettings.CurrentSetting.UseBuffFood && sRogueSettings.CurrentSetting.BuffFoodName != null && sRogueSettings.CurrentSetting.BuffFoodBuffName != null) { uint foodID = wManager.Wow.Helpers.ItemsManager.GetIdByName(sRogueSettings.CurrentSetting.BuffFoodName); if (!ObjectManager.Me.HaveBuff(sRogueSettings.CurrentSetting.BuffFoodBuffName) && ItemsManager.HasItemById(foodID) && wManagerSetting.CurrentSetting.FoodName != sRogueSettings.CurrentSetting.BuffFoodName) { wManagerSetting.CurrentSetting.FoodName = sRogueSettings.CurrentSetting.BuffFoodName; } else if (ObjectManager.Me.HaveBuff(sRogueSettings.CurrentSetting.BuffFoodBuffName) && wManagerSetting.CurrentSetting.FoodName != originalFoodSetting) { wManagerSetting.CurrentSetting.FoodName = originalFoodSetting; } } }
-
1 hour ago, sjb211 said:
Do you know how to solve the switching target to keep DOT way?
Thanks if there is a way to share a complete solutionI never got around to it as i gave my lock to a friend who leveled it further by hand.
But with my current knowledge I would say look into FightEvents.OnFightLoop (or potentialy even FightEvents.OnFightEnd / FightEvents.OnFightStart).
Just grab the number of targets you are willing to fight, put them in a list, and then cycle through that list using for example if (!u.HaveBuff("Corruption")) Then Interact.InteractGameObject(u). It also depends on how your fightclass is setup.
-
Just now, BetterSister said:
ban reports area speaks for itself. Not a single ban this month?
Well that's good
-
35 minutes ago, BetterSister said:
Talking about HB. They got update yesterday claiming it's safe and people are still getting automatically banned within 1 hour
Btw, how is Wrobot doing on retail?
-
I will be playing classic!
-
On 3. 11. 2017 at 9:09 PM, krlitoz said:
Blizzard just announced the development of Legacy Wow Servers at the 2017 Blizzcon.
Do you plan on providing more support to the vanilla version of the bot for the official servers?
I was just about to create a thread on this.
I suspect they will use quite a bit of modern stuff in Classic. For example API / LUA. If a function get removed since Vanilla I don't pressume they will use it for classic just for the sake of remaining "pure". The thing to realize is that Classic WoW will not be the same game so a new Wrobot version will have to be created.
However, I'm keen to hear @Droidz's take on this. Will a new version of Wrobot for Classic have to be created, since (pressumably) the offsets will be all messed up? If so, how long do you estimate it will take to get the bot up and running after release? Thanks mr.D
-
So I made it work. I basically used a bool inside the OnFightLoop and set it to true when there are more than 1 mob attacking me. While true my BAU combat rotation won't trigger... once the Poly is applied, the bool is set to false and normal combat continues.
To wake the sheep just CastSpellByNameLUA.
-
Well no luck, as I was saying the OnFightLoop and my BAU rotation are being combined together. So instead of casting polymorph, it tries to cast Frostbolt all the time... Dang it...
-
I'm trying to save the polyTarget but I guess i can grab it manually after the fact.
-
Absolutely noob question.
Inside the OnFightLoop I have WoWUnit currentTarget = etc.etc. What the heck do I need to do to be able to use it in an IF statement outside of the OnFightLoop?
I want to test using it in my main rotation "if polyTarget.IsValid" (now gives an error) and if that is true I want to do "Interact.InteractGameObject(polyTarget.GetBaseAddress);" which also gives an error, saying it doesn't exist in the current context.
Do I need to define it at the start? What type do I define it as?
-
4 minutes ago, Matenia said:
You are actually subscribing to an event (hence the term event handler).
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/events/how-to-subscribe-to-and-unsubscribe-from-events
So your entire code ALWAYS gets executed - but whatever follows this event (the original fighting code by wRobot) can be stopped by setting cancelable.Cancel to true.So both the OnFightLoop and my FightClass code will get executed, the only thing we are cancelling is wrobot's "default built in" fighting code / behavior? That's strange, kind of. If that is so, what would happen if I did:
FightEvents.OnFightLoop += (unit, cancelable) => { cancelable.Cancel = true; };
Well, time to experiment...
-
Sorry, I don't follow. My understanding is the OnFightLoop "loop" is acting like a while loop everytime I'm in combat, doing its thing continuously.
Let's say, if I have the code below and the first argument would be true, cancelable.Cancel would be set to true, what would happen? It would skip the second if argument in the OnFightLoop and start right from the start?
FightEvents.OnFightLoop += (unit, cancelable) => { if (ObjectManager.Target.GetDistance <= 8 && (!ObjectManager.Target.HaveBuff("Frost Nova") || !ObjectManager.Target.HaveBuff("Frostbite")) && (_timerFrostNova == null || _timerFrostNova.IsReady) && ObjectManager.Target.HealthPercent >= 20) { Move.StrafeRight(Move.MoveAction.PressKey, 1250); cancelable.Cancel = true; } if (ObjectManager.Target.GetDistance <= 10 && (!ObjectManager.Target.HaveBuff("Frost Nova") || !ObjectManager.Target.HaveBuff("Frostbite")) && (_timerFrostNova == null || _timerFrostNova.IsReady) && ObjectManager.Target.HealthPercent >= 20) { Move.StrafeLeft(Move.MoveAction.PressKey, 1250); } };
If that is the case can I disable OnFightLoop? I'm looking at the += and thinking if I did -= it would somehow remove things from the OnFightLoop? If so, how?
Btw guys, this is great, this is how I like to learn, not sitting in books, that doesn't work for me at all. I have to dive right in and figure things out on real life examples. ;) Thanks for being so helpful!
-
1 hour ago, Matenia said:
cancelable.Cancel = true is correct. However, I recommend NOT breaking the OnFightLoop event handler UNTIL your target has been successfully polymorphed. You can solve this with a while loop (Thread.Sleep inside) until poly is on another target.
Just so I understand... From my testing today I found out that if I have OnFightLoop it combines my BAU rotation with the OnFightLoop rotation. It doesn't really seem it superseeds the BAU rotation. So if I go cancelable.Cancel = true; what will it cancel? The OnFightLoop rotation or everything else except the OnFightLoop rotation?
Can Cancel be used from within the OnFightLoop?
Prioritize Low HP targets
in Fight Classes assistance
Posted
Let us know if it works for you Lockem.