ship warp to belt_bookmark
ship warp to closest wreck
open wreck, open ship_cargo
Get Entites in wreck
NOT loot
warp to next belt bookmark
help please
ship warp to closest wreck
open wreck, open ship_cargo
Get Entites in wreck
NOT loot
warp to next belt bookmark
Code:
function LootClosestWreck()
{
variable index:entity Wrecks
variable iterator Wreck
variable index:item Items
variable iterator Item
variable index:int ItemsToMove
variable float TotalVolume = 0
variable float ItemVolume = 0
/* only look for wrecks within 3000 meters */
EVE:DoGetEntities[Wrecks,GroupID,GROUPID_WRECK,Radius,3000]
Wrecks:GetIterator[Wreck]
if ${Wreck:First(exists)}
{
do
{
if ${Wreck.Value(exists)} && ${Wreck.Value.IsWreckEmpty} == FALSE
{
call Ship.Approach ${Wreck.Value.ID} LOOT_RANGE
Wreck.Value:OpenCargo
wait 10
call Ship.OpenCargo
wait 10
Wreck.Value:DoGetCargo[Items]
UI:UpdateConsole["obj_Scavenger: DEBUG: Wreck contains ${Items.Used} items."]
Items:GetIterator[Item]
if ${Item:First(exists)}
{
do
{
ItemVolume:Set[${Item.Value.Quantity} * ${Item.Value.Volume}]
if ${Math.Calc[${ItemVolume} + ${TotalVolume}]} < ${Ship.CargoFreeSpace}
{
ItemsToMove:Insert[${Item.Value.ID}]
TotalVolume:Set[${Math.Calc[${ItemVolume} + ${TotalVolume}]}]
}
}
while ${Item:Next(exists)}
}
if ${ItemsToMove.Used} > 0
{
echo "in IF" <==== work, ItemsToMove.Used > 0
[COLOR="Red"]EVE:MoveItemsTo[ItemsToMove, MyShip][/COLOR] <==== not work
wait 10 <==== if wait 100 or wait 200 - not work
}
return
}
}
while ${Wreck:Next(exists)}
}
}
}