What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Command to loot mobs?

zuabros

Active Member
Joined
Jan 12, 2011
Messages
651
Reaction score
82
How do I insert a line in a plugin telling the bot to loot mobs?

I need that to do a plugin that will loot mobs even in combat (to grind insta-respawn mobs).
 
dno - made my own loot method - I can post the code here tomorrow.
 
You need to make sure a unit is lootable before you do so. The easiest way to do it is probably a list of lootable units.

PHP:
IEnumerable<WoWUnit> mLootableMobs = ObjectManager.GetObjectsOfType<WoWUnit>(false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();

To loot a target you first must interact with it, then signal HB to loot.

PHP:
WoWUnit.Interact();
Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();

Of course putting the entire thing together isn't as easy. You need to iterate through the list, move to the the lootable target, and ensure that you're only attempting to loot one target at any one point. But the above code shows the basic commands you need to make it work.
 
Where do mobs instant respawn?

This is the profile I made... It is a grind profile that will grind the 10k+ overvalued Glorious Breastplate... the grind profile runs flawlessly, BUT it won't loot mobs!!! :(((

No fun in killing freshy instanced insta-respawn mobs if they won't be looted... :(

...

Please, anyone help :)


Zone: AQ20
Mobs: Quiraji Gladiator ; that guard Moan's room. General Rajaxx and his adds must be left untouched (skiped) for the insta-respawn to occur (easily skiped), won't aggro.
Botbase: Grindbot
Grinding what?
- Glorious Breastplate will drop from those mobs...
- as a side effect, each mobs gives 11 Cenarion Circle reputation (4708 rep/h)

Instructions for it to work "more or less":
1. use melee class
2. disable CC movement
3. set loot distance to 4
4. Expected result: bot will pull with ranged spell, kill mob far from spawn point with melee, and will only loot if it dies near bot (to avoid chain-agro).

The profile, as-is, kills more than 700 mobs/h, as they are instant-respawn... BUT it won't loot half, as it keeps in combat most of the time :(... thats why I need that looting plugin :(
tumblr_lxt2cgZJhA1r5jj9ao1_r1_250.webp
 

Attachments

Last edited:
You need to make sure a unit is lootable before you do so. The easiest way to do it is probably a list of lootable units.

PHP:
IEnumerable mLootableMobs = ObjectManager.GetObjectsOfType(false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();

To loot a target you first must interact with it, then signal HB to loot.

PHP:
WoWUnit.Interact();
Styx.Logic.Inventory.Frames.LootFrame.LootFrame.Instance.LootAll();

Of course putting the entire thing together isn't as easy. You need to iterate through the list, move to the the lootable target, and ensure that you're only attempting to loot one target at any one point. But the above code shows the basic commands you need to make it work.

:( its more complicated than I thought... well above my programming skills allow.
 
dno - made my own loot method - I can post the code here tomorrow.

that would be great :)

those are my best results obtained without the loot plugin: 394 loots/h
 

Attachments

  • deu.webp
    deu.webp
    69.6 KB · Views: 88
Last edited:
I left 2 accounts running this profile for 4 hours. No Glorious Plate yet, but lots of greens... here are my results. Will let it farm for some more hours now...
 

Attachments

  • conta2.webp
    conta2.webp
    40.8 KB · Views: 70
  • conta1.webp
    conta1.webp
    43 KB · Views: 62
Last edited:
I just threw this together - I didn't have VS or HB so I can't promise anything - but I guess it should work as long as your CC doesn't do movement..
 

Attachments

I just threw this together - I didn't have VS or HB so I can't promise anything - but I guess it should work as long as your CC doesn't do movement..

wow, thanks great, but won't compile :(

Plugin from C:\Users\PCPC\Desktop\hb5456\Plugins\Combat Looter.cs could not be compiled! Compiler errors:

File: Combat Looter.cs Line: 67 Error: 'Styx.WoWInternals.WoWObjects.WoWUnit' n?o cont?m uma defini??o para 'name' e nenhum m?todo de extens?o 'name' aceita que um primeiro argumento de tipo 'Styx.WoWInternals.WoWObjects.WoWUnit' seja encontrado (voc? n?o est? usando uma diretriz ou refer?ncia de assembly?)
 
zuabros, just the concepts:

Pulse() method is fired at each bot cycle (which means after the behavior tree of the BotBase). You have to check every pulse for lootable creatures. Then you'll have a list. For example
PHP:
List<WoWUnit> lootable = ObjectManager.GetObjectsOfType<WoWUnit>(false, false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();

Then you take the first one:
PHP:
WoWUnit? target = lootable.FirstOrDefault<WoWUnit>();
(WoWUnit? stands for nullable, if I remember correctly. Haven't coded nullable things by a while in C#)

Check if the target is not null, cast it as WoWUnit in case it's not null and then generate a Navigator path and follow it. When you're distant less than 5 yards, interact with target.

EDIT: it's not kind to post multiple threads, even in the same forum, for the same reason: http://www.thebuddyforum.com/honorb...gin-request-loot-mobs-combat-please-help.html
 
Last edited:
zuabros, just the concepts:

Pulse() method is fired at each bot cycle (which means after the behavior tree of the BotBase). You have to check every pulse for lootable creatures. Then you'll have a list. For example
PHP:
List lootable = ObjectManager.GetObjectsOfType(false, false).Where(unit => unit.CanLoot && !unit.IsAlive && unit.Distance <= 40).OrderBy(unit => unit.Distance).ToList();

Then you take the first one:
PHP:
WoWUnit? target = lootable.FirstOrDefault();
(WoWUnit? stands for nullable, if I remember correctly. Haven't coded nullable things by a while in C#)

Check if the target is not null, cast it as WoWUnit in case it's not null and then generate a Navigator path and follow it. When you're distant less than 5 yards, interact with target.

EDIT: it's not kind to post multiple threads, even in the same forum, for the same reason: http://www.thebuddyforum.com/honorb...gin-request-loot-mobs-combat-please-help.html

Thank you... in fact I usually don't. First I requested for the plugin, but as it seemed people woudn't just "make" a plugin, I decieded to ask for help to make one myself; it's different things... :) anyway... making one myself is far beyond my habilities, it seems
</wowunit></wowunit></wowunit>
 
I just threw this together - I didn't have VS or HB so I can't promise anything - but I guess it should work as long as your CC doesn't do movement..

File: Combat Looter.cs Line: 67 Error: 'Styx.WoWInternals.WoWObjects.WoWUnit' n?o cont?m uma defini??o para 'name' e nenhum m?todo de extens?o 'name' aceita que um primeiro argumento de tipo 'Styx.WoWInternals.WoWObjects.WoWUnit' seja encontrado (voc? n?o est? usando uma diretriz ou refer?ncia de assembly?)

File: Combat Looter.cs Line: 67 Error: 'Styx.WoWInternals.WoWObjects.WoWUnit' does not contain a definition for 'name' and no extension method 'name' accept that a first argument of type 'Styx.WoWInternals.WoWObjects.WoWUnit' to be found (are not you using a directive or assembly reference?)
 
C# is case sensitive for just about everything. In order for this to compile, you will need to change line 67 from
Code:
                slog("Moving to loot {0}.", lootTarget.name);
to
Code:
                slog("Moving to loot {0}.", lootTarget.Name);
 
this plugin made me jizz my pants....
can't thank you enough
 
Is there a way to have the Combat Looter plugin turn on and off in say questing profile?
 
Is there a way to have the Combat Looter plugin turn on and off in say questing profile?
I don't think so..

And since it seems to be so useful, I'll make a thread with it ^^ My first plugin >_>
 
Back
Top