Skip to main content
Apocalypse Rising 2 only. Watch and shape the Auto Loot feature. You can read whether it’s on, react when it acts, block items or action types it isn’t allowed to do, force it to grab specific items, and kick off a loot pass on demand. Everything here only ever limits or nudges Auto Loot. Your filters can stop it from doing things the menu would otherwise allow, but they can’t make it ignore the user’s own settings, and a forced item is still only grabbed when there’s room for it.

What you can read

CallReturnsWhat it tells you
isEnabled()booleanWhether Auto Loot is turned on in the menu.
isActive()booleantrue while it’s mid-pass, working through loot.

Things that notify you

Call :Connect(callback). Disconnects on unload.
SignalYour callback receives
onAction(action): each time Auto Loot performs a loot action. See the table below.
The action table:
{
    type = "pickup",   -- pickup | drop | equip | unload | fill | craft | removeAttach | slotUtility
    kind = "weapon",   -- weapon | mag | ammo | heal | food | drink (pickups only, else nil)
    name = "AK-47",    -- item name when known, else nil
    caliber = "7.62x39",
    slot = "Primary",  -- equip slot when relevant, else nil
}
See AutoLootAction.

Shaping what it does

All registrations return a handle with :Release(). They’re also released when your script unloads.
CallWhat it does
addItemFilter(fn, priority?)Decide whether Auto Loot may pick up / keep an item.
addActionFilter(fn, priority?)Decide whether a chosen action may run.
blockItem(name or {names})Shortcut: never pick up the named item(s).
blockAction(type or {types})Shortcut: never perform the named action type(s), e.g. "drop".
forceItem(name, durationSec?)Always grab the named item off nearby loot when there’s room, ahead of normal priorities. Optional auto-expiry.
scan()Kick off a loot pass right now.
  • addItemFilter(fn(item)): runs for pickup / utility-slot decisions. The item is { name, rawName, type, caliber, slot }. Return false to block that item. Every filter must pass.
  • addActionFilter(fn(action)): runs right before an action executes. The action is the same shape as the onAction table. Return false to block it. Every filter must pass.
  • Higher priority runs first; equal priority runs in registration order. A blocked action goes on a short cooldown and Auto Loot moves on to the next best thing, so blocking one item or action never stalls the rest.

Examples

-- Never loot a specific gun, and never let it drop your gear
api.autoloot.blockItem("Makarov")
api.autoloot.blockAction("drop")

-- Only ever pick up 7.62 ammo
api.autoloot.addItemFilter(function(item)
    if item.type == "Ammo" then
        return item.caliber == "7.62x39"
    end
    return true
end)

-- Force-grab medkits for the next 30 seconds, then scan now
api.autoloot.forceItem("Medkit", 30)
api.autoloot.scan()

-- Log everything it does
api.autoloot.onAction:Connect(function(action)
    print("autoloot", action.type, action.name)
end)

Types

AutoLootItem, AutoLootAction, AutoLootHandle.