Entity:LootAll

Amadeus

The Maestro
Staff member
Someone was asking me about the "Loot All" button on container type entity cargo windows. I checked, and this is almost exactly what EVE is doing for "Loot All", and it's much easier than me adding it inside of ISXEVE.

You could call this function with any entity (i.e., "call LootCargoContainer ${Me.ActiveTarget}")

Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Loot the cargo container passed as the argument "CargoContainer"
;; (NOTE:  This function assumes that "CargoContainer" is within looting range.)
function LootCargoContainer(entity CargoContainer)
{    
        variable iterator ThisCargo
        variable index:item EntityCargo
        variable index:int64 CargoToTransfer
        
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
        ;; Open Entity for looting
        CargoContainer:OpenCargo
        wait 20
        call OpenShipCargo                    
        ;;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

        CargoContainer:GetCargo[EntityCargo]
        EntityCargo:GetIterator[ThisCargo]
        if ${ThisCargo:First(exists)}
        {
            do
            {
                CargoToTransfer:Insert[${ThisCargo.Value.ID}]
            }
            while ${ThisCargo:Next(exists)}
        }
        ;;
        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
            

        EVE:MoveItemsTo[CargoToTransfer, MyShip]
        return
}
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Opens the player's ship cargo hold
function OpenShipCargo()
{
    if !${EVEWindow[MyShipCargo](exists)}
    {
        echo "Opening Ship Cargohold"
        MyShip:OpenCargo
        wait 15
        while !${EVEWindow[MyShipCargo](exists)}
        {
            wait 0.5
        }
        wait 10
    }
}
 
Top Bottom