sleep(1000);
public function autoLoot(_arg_1:int = -1):void
{
var _local_4:int;
var _local_2:int;
var _local_5:* = null;
if (_arg_1 == -1)
{
_arg_1 = getTimer();
}
if ((_arg_1 - this.map_.gs_.gsc_.lastInvSwapTime) <= 500)
{
return;
}
if ((((this.isInventoryFull()) && ((Parameters.data_.autoLootHPPots) && (healthPotionCount_ == 6))) && ((Parameters.data_.autoLootMPPots) && (magicPotionCount_ == 6))))
{
return;
}
for each (var _local_3:GameObject in this.map_.goDict_)
{
if ((((_local_3 is Container) && (_local_3.equipment_)) && (PointUtil.distanceSquaredXY(this.x_, this.y_, _local_3.x_, _local_3.y_) <= 1)))
{
_local_4 = 0;
while (_local_4 < 8)
{
_local_2 = _local_3.equipment_[_local_4];
if (_local_2 != -1)
{
_local_5 = ObjectLibrary.propsLibrary_[_local_2];
if (_local_5)
{
if ((((Parameters.data_.autoDrinkFromBags) && (_local_5.isPotion_)) && (shouldDrink_incAndOpti(_local_2))))
{
drink(_local_3, _local_4, _local_2);
}
else
{
if (((_local_5.desiredLoot_) || ((Parameters.data_.autoLootUpgrades) && (checkForUpgrade(_local_5)))))
{
sleep(1000);
pickup(_local_3, _local_4, _local_2);
}
}
}
}
_local_4++;
}
}
}
}