Jump to content

Seminko

Members
  • Posts

    225
  • Joined

  • Last visited

Everything posted by Seminko

  1. Will do. Also, still struggling with MultiTargeting... :( I update code i posted above and now it should do one of the following things: If a mob is attacking me, and is not my target, switch to that mob and tell pet to attack it If a mob is attacking me, and is my target, tell pet to attack it If no mob is attacking me, check whether they have Corruption and CoA, if they don't apply it However what happens is that the bot switches the targes but doesn't cast anything... It looks like what Matenia said that you cannot tell the bot what target to choose, so it switches targets, seems like it cannot cast the spell and immediatelly switches back. Ideas? internal void MultiTargetRotation() { var unitsAffectingMyCombat = ObjectManager.GetUnitAttackPlayer(); if (unitsAffectingMyCombat.Count <= 0) return; var unitsAttackMe = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMe).ToList(); if (unitsAttackMe.Count >= 1) { var unitToAttack = unitsAttackMe.FirstOrDefault(u => u != null && u.IsValid && !u.IsMyPetTarget); if (unitToAttack != null && unitToAttack.IsValid && unitToAttack.IsAlive) { if (!unitToAttack.IsMyTarget) Interact.InteractGameObject(unitToAttack.GetBaseAddress, !ObjectManager.Me.GetMove); Lua.LuaDoString("PetAttack();"); if (unitToAttack.IsMyTarget) Lua.LuaDoString("PetAttack();"); Logging.Write("PET ATTACKING: " + unitToAttack); } } else { var unitsAttackPet = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMyPet && (!u.HaveBuff("Corruption") || !u.HaveBuff("Curse of Agony"))).FirstOrDefault(); if (unitsAttackPet != null && unitsAttackPet.IsValid && unitsAttackPet.IsAlive && !unitsAttackPet.IsMyPetTarget) { if (!unitsAttackPet.IsMyTarget) { if (!unitsAttackPet.HaveBuff("Corruption") && Corruption.IsSpellUsable) { Interact.InteractGameObject(unitsAttackPet.GetBaseAddress, !ObjectManager.Me.GetMove); SpellManager.CastSpellByNameLUA("Corruption"); } if (!unitsAttackPet.HaveBuff("Curse of Agony") && CurseOfAgony.IsSpellUsable) { Interact.InteractGameObject(unitsAttackPet.GetBaseAddress, !ObjectManager.Me.GetMove); SpellManager.CastSpellByNameLUA("Curse of Agony"); } } if (unitsAttackPet.IsMyTarget) { if (!unitsAttackPet.HaveBuff("Corruption") && Corruption.IsSpellUsable) { SpellManager.CastSpellByNameLUA("Corruption"); } if (!unitsAttackPet.HaveBuff("Curse of Agony") && CurseOfAgony.IsSpellUsable) { SpellManager.CastSpellByNameLUA("Curse of Agony"); } Lua.LuaDoString("PetAttack();"); } } } }
  2. I tried using StopMoveTo before casting my spell but does not have any effect. As I was saying, once the bot is in combat mode and stops to prepare for fight then it creates the HS but otherwise my log shows it tried creating it but didn't stop. public bool CreateHealthstone() { if (ItemsManager.GetItemCountByIdLUA(5512) == 0 && ItemsManager.GetItemCountByIdLUA(19004) == 0 && ItemsManager.GetItemCountByIdLUA(19005) == 0 && !ObjectManager.Me.InCombat) { MovementManager.StopMoveTo(false, 500); Logging.WriteDebug("Creating Healthstone"); SpellManager.CastSpellByNameLUA("Create Healthstone (Minor)()"); Thread.Sleep(Usefuls.Latency + 3500); return false; } return true; }
  3. Still not able to test since the servers are down. I still need to figure out the Voidwalker summon / Healthstone creation situation. As I described above: I checked the How to create a fight class from Droidz and he has this in his PetManager class: public override void Run() { if (!ObjectManager.Pet.IsValid) { _callPet.Launch(true); Thread.Sleep(Usefuls.Latency + 1000); } if (!ObjectManager.Pet.IsValid || ObjectManager.Pet.IsDead) _revivePet.Launch(true); _petTimer = new Timer(1000 * 2); } I see override, does this actually overrieds the default bot behavior? To be honest I don't know how I would incorporate it into my script. I'm putting together multiple scripts from multiple sources. Here is my potato script and how I handle the combat: private void GetFightingState() { if ((ObjectManager.Pet.IsValid && !ObjectManager.Pet.IsDead) && ObjectManager.Pet.HealthPercent < 7) { fightState = fightingStateEnum.LowPetHealth; return; } else if (ObjectManager.Me.HealthPercent < 25 && (_timer == null || _timer.IsReady) && (ItemsManager.GetItemCountByIdLUA(5512) >= 1 || ItemsManager.GetItemCountByIdLUA(19004) >= 1 || ItemsManager.GetItemCountByIdLUA(19005) >= 1)) { fightState = fightingStateEnum.LowPlayerHealth; return; } else if (DrainSoul.IsSpellUsable && ObjectManager.Target.HealthPercent < 35) { fightState = fightingStateEnum.TargetLowHealth; return; } else if (LifeTap.IsSpellUsable && ObjectManager.Me.ManaPercentage < 17 && ObjectManager.Me.HealthPercent >= 25 && !ObjectManager.Target.HaveBuff("Drain Soul")) { fightState = fightingStateEnum.LowPlayerMana; return; } else if (Corruption.IsSpellUsable && !ObjectManager.Target.HaveBuff("Corruption") && !ObjectManager.Target.HaveBuff("Drain Soul")) { fightState = fightingStateEnum.CorruptionNeed; return; } else if (CurseOfAgony.IsSpellUsable && !ObjectManager.Target.HaveBuff("Curse of Agony") && !ObjectManager.Target.HaveBuff("Drain Soul")) { fightState = fightingStateEnum.CoANeed; return; } else if (Fear.IsSpellUsable && ObjectManager.GetWoWUnitHostile().Count(u => u.GetDistance <= 5 && u.IsAttackable) >= 2 && !ObjectManager.Target.BuffCastedByAll("Fear").Contains(ObjectManager.Me.Guid) && !ObjectManager.Target.HaveBuff("Drain Soul")) { fightState = fightingStateEnum.TargetClose; return; } else if (ShadowBolt.IsSpellUsable) { fightState = fightingStateEnum.SpamShadowBolt; return; } else { if (EquippedItems.GetEquippedItem(WoWInventorySlot.Ranged) != null && !Lua.LuaDoString<bool>("return IsAutoRepeatAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Shoot")) + 1) + ")") && ObjectManager.Me.ManaPercentage < 17 && ObjectManager.Me.HealthPercent < 25) { if (Shoot.KnownSpell) SpellManager.CastSpellByNameLUA("Shoot"); return; } } } public void Start() { Logging.Write("Seminko's Warlock Loaded"); while (iMageLaunched) { if (!Products.InPause) { GetFightingState(); if (!ObjectManager.Me.IsDeadMe) { GetFightingState(); if (!ObjectManager.Me.IsMounted && BuffRotation() == false && !ObjectManager.Me.InCombat) { BuffRotation(); } if (Fight.InFight && ObjectManager.Me.Target > 0) { GetFightingState(); CombatRotation(); } } } Thread.Sleep(10); } Logging.Write("Warlock is now stopped."); } public bool BuffRotation() { if (!ObjectManager.Me.InCombat) SummonPet(); BuffArmor(); TapForManaOoc(); ShardManagement(); CreateHealthstone(); if (BuffArmor() == true && TapForManaOoc() == true && SummonPet() == true && ShardManagement() == true && CreateHealthstone() == true) return true; else return false; }
  4. Hi iMod, what does it do exactly? It seems it puts all mobs with HP lower than 10 into a list or an array?
  5. Brilliant! I have also found this code: internal void MultiTargetRotation() { var unitsAffectingMyCombat = ObjectManager.GetUnitAttackPlayer(); if (unitsAffectingMyCombat.Count <= 0) return; var unitsAttackMe = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMe).ToList(); if (unitsAttackMe.Count > 1) { var unitToAttack = unitsAttackMe.FirstOrDefault(u => u != null && u.IsValid && !u.IsMyPetTarget); if (unitToAttack != null && unitToAttack.IsValid && unitToAttack.IsAlive) { if (!unitToAttack.IsMyTarget) Interact.InteractGameObject(unitToAttack.GetBaseAddress, !ObjectManager.Me.GetMove); if (unitToAttack.IsMyTarget) Lua.LuaDoString("PetAttack();"); Logging.Write("PET ATTACKING: " + unitToAttack); } } //IF ALL THE MOBS ARE ATTACKING THE PET FOCUS THE LOWER HP ONE else { var unitsAttackPet = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMyPet).ToList(); var lowerHpUnit = unitsAttackPet.OrderBy(unit => unit.HealthPercent).FirstOrDefault(); if (lowerHpUnit != null && lowerHpUnit.IsValid && lowerHpUnit.IsAlive && !lowerHpUnit.IsMyPetTarget) { if (!lowerHpUnit.IsMyTarget) Interact.InteractGameObject(lowerHpUnit.GetBaseAddress, !ObjectManager.Me.GetMove); if (lowerHpUnit.IsMyTarget) Lua.LuaDoString("PetAttack();"); Logging.Write("PET ATTACKING LOWER HP: " + lowerHpUnit); } } } Also, since you know your coding, say I would like to summon voidwalker or create healthstone, how do I make the bot stop searching for targets and just stay still until it is summoned? I use IsSpellUsable to check if I have enough mana and if I do, sometimes the bot wants to summon the voidwalker but it's trying to do it while running. It seems once it finds its target it moves to the defined range, stops AND THEN summons the voidwalker.
  6. Oh snap, now you confused me :-D First of all a lambda expression? What is this, half life? :-D It loops through all the targets but it returns only ONE entry... hmm... let's consider this scenario, there are three mobs attacking me and none of them have corruption, the script will find the first mob as missing Corruption and cast it on him but that's it. It would have found the first, in other words - ONE, mob that matches that criteria and be done with it. But the other two will still be missing corruption? Or am I mistaken? This is great, this is how I learn things when I can chat with skilled ppl like you! Appreciate that!
  7. Interesting, so '.Where(o => ' is a loop expression? Once the servers are up again I will fiddle with it and get back to you.
  8. So you would just temporarily switch targets to apply the dots? I'm a Csharp noob but from what I gathered the script you posted just checks for a mob that is attacking you, assigns it the corruption target variable and checks whether it is valid, it is alive and whether it has corruption or not. Now I need something like a For loop to loop through all targets attacking me based on the 'GetUnitAttackPlayer().Count()' right? Are mobs that are attacking the voidwalker considered GetUnitAttackPlayer?
  9. I edited my previous post: Also, quite often it happens that I will pull mobs in the middle of the fight unintentionally. I'm thinking with warlocks dots I would like to pull mobs in the middle of the fight in fact if a mob spawns or gets in a certain range.
  10. unfortunately, we are in fact in vanilla formus :) EDIT: if we were in non-vanilla-wow where would I put the code in? I use the grinder and a fight class. With my limited understanding it looks the fight class doesn't handle targeting.
  11. I was looking for a plugin or a code snippet that would alternate tagets. I found MultiPull plugin which is great but it's pretty limited. It will pull a number of targets but then still tunnel vision the last one it pulled I play a warlock and even though I wrote my script in a way that each new dot will make the voidwalker attack that target (to hold aggro), sometimes with multipull what happens is that I will cast the dot, but before voidwalker reaches the target to taunt it MultiPull pulls another target so the voidwalker switches targets before it can taunt the first one which results in the second mob being tanked by voidwalker and the first target attacking me. The other annoying thing is that once I pull multiple mobs, once the dots are off from the first target, they are not applied again until the last target which is tunneled is dead. My idea is this, let's keep MultiPull as is, but let's come up with another code that would: scan debuffs on mobs which are in combat with me or with voidwalker if any expire switch target and reapply if any of the mobs that are in combat with me or my voidwalker are focusing me, make the voidwalker switch to that target. Dear mr @Droidz is that even possible?
  12. I would really like to try the event, without the while loops. I saw you giving the exact code with UNIT_SPELLCAST_SUCCEEDED to someone and he "liked" it so presumably it works. Not sure why it doesn't work for my particular case. Maybe cause it's a plugin and with how they are structured?
  13. How is this different to what I'm doing? I'm checking for item cooldown, you're checking for spell cooldown.
  14. wManager.Wow.Enums.LuaEventsId doesn't containt definition for UNIT_SPELLCAST_SUCCEEDED I'm using vanilla wrobot
  15. Will look into it. Thanks!
  16. Version 1.0.0

    29 downloads

    I've been using Schedule product for a while now but was not able to figure out how to shutdown pc after it's done. I am still not lvl 60 so I use the Scheduler in a way that it ends with /To home, in other words it uses HS. So I coded this plugin to check HS cooldown. If it is on CD, which means the Scheduler has finished, it shuts down the PC. WARNING: do not start bot with this plugin enabled when having your HS on CD, it will shut your PC down right then and there, obviously ;)
  17. Hey Droidz found another issue with lures. In Vanilla Aquadynamic Fish Attractor only lasts 5minutes. So if I put it into the Lure Name inputbox it works but only refreshes every 10minutes and if I put it into the other two inputs it doesn't work at all. EDIT: actually the tooltip is wrong, it was supposed to be 5minutes and it says 5minutes but when you apply it, the buff says 10.
  18. So I found there is an option in the Scheduler to /To home, which I pressume is using HS. That's great since I'm still not 60 yet. Another great option is the Stop bot when finished. My question is, can you make it so that it performs the scheduled tasks, ending with /To home and THEN shutting the bot down as well as the computer? Been searching but nothing concrete about the Scheduler.
    Combined with 'Song on Whisper' this is the best trade advertiser imaginable! Thank you!
  19. I did. Thanks man. Don't know about decompiling, but will look into it! Cheers
  20. Heya, this is related to vanilla. I'm working on my buff routine which includes creating a Mana Agate and its equivalents. The issue is that when my bags are full it tries creating it over and over again. Is there a way to check whether inventory is full? Thanks Seminko EDIT: also, is there a way to check if another action is in progress? What happens is that when I cast Evocation, the bot will cast a buff and screw up the Evocation.
  21. Omg, that's it! Thanks @reapler !
×
×
  • Create New...