Class GroundLoot
java.lang.Object
privbot.restock.GroundLoot
Picks up ground items by name fragment and proves each pickup: Take, then wait for the inventory count of that id to
rise. A full inventory with no stack of that id leaves the item and says so; nothing is dropped or eaten to make room.
Looting by name, reusable by any plugin. One instance per plugin; script worker only.
Rows: loot_seen, loot_pickup, loot_confirmed, loot_skipped, loot_failed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDetached ground item facts (read on the client thread, used on the worker).static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA Take that never lands is tried this many times, then that item is left (it may belong to someone else). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidnewDrop()Forgets what was seen and skipped (a new kill, a new Start); the picked total stays untilreset().intpicked()voidreset()takeOne(PrivTaskContext ctx, List<String> fragments, RestockHost host) Takes the nearest wanted item and confirms it by the inventory count of its id rising.wanted(PrivTaskContext ctx, List<String> fragments, RestockHost host) The wanted ground items in reach that were not skipped, nearest first.
-
Field Details
-
MAX_TAKE_FAILURES
public static final int MAX_TAKE_FAILURESA Take that never lands is tried this many times, then that item is left (it may belong to someone else).- See Also:
-
-
Constructor Details
-
GroundLoot
public GroundLoot(int radiusTiles, int confirmMs) - Parameters:
radiusTiles- how far from the player to lookconfirmMs- how long a Take may take to show in the inventory (it includes the walk to the item)
-
-
Method Details
-
picked
public int picked() -
newDrop
public void newDrop()Forgets what was seen and skipped (a new kill, a new Start); the picked total stays untilreset(). -
reset
public void reset() -
wanted
public List<GroundLoot.Ground> wanted(PrivTaskContext ctx, List<String> fragments, RestockHost host) The wanted ground items in reach that were not skipped, nearest first. Any thread (one client-thread read). -
takeOne
Takes the nearest wanted item and confirms it by the inventory count of its id rising. Script worker.
-