Moving from Cargo to POS

oneoneone

Active Member
I'm having varied results moving cargo from my ship to a Corporate Hangar Array (POS).

I've tried various forms of this

Code:
Entity[Corporate Hangar Array]:OpenCargo
wait 30
i:Set[1]

MyCargoCount:Set[${Me.Ship.GetCargo[]}]
 
do
{ 
   MyCargo.Get[${i}]:MoveTo[${Entity[Corporate Hangar Array].ID},${Me.Ship.Cargo[${i}].Quantity},Corporation Folder 1]
   wait 100
}  
while ${i:Inc} <= ${MyCargoCount}
and sometimes it works for some of the stacks of items in my inventory and sometimes it doesn't work for any. When it does work, it never empties your inventory completely. There is always something left over.

Everything appears to be setup correctly but maybe I'm just not doing it right. Has anyone had success moving items from your hauler to your POS?
 

Amadeus

The Maestro
Staff member
errr

This line is not right:

Code:
MyCargoCount:Set[${Me.Ship.GetCargo[]}]
I think you wanted:
Code:
MyCargoCount:Set[${Me.Ship.GetCargo[MyCargo]}]
 

oneoneone

Active Member
Both ways seemed to work the same. Having it set as
Code:
${Me.Ship.GetCargo[MyCargo]}
didn't work for me either.
 

oneoneone

Active Member
Figured it out to an extent. There's a problem with the way
Code:
MyCargo.Get[${i}]:MoveTo[${Entity[Corporate Hangar Array].ID},${Me.Ship.Cargo[${i}].Quantity},Corporation Folder 1]
is setup. I don't know enough about the way index's work in LavishScript to fully understand it but the Quantity it's trying to move doesn't always match up with the index for where the item is in your cargo hold. Some items get skipped or only partially moved. By changing
Code:
${Me.Ship.Cargo[${i}].Quantity}
to 999999999 it will move everything over. As long as its less than 999999999 million obviously.

In a nut shell,
Code:
MyCargo.Get[${i}]
doesn't always match up with
Code:
${Me.Ship.Cargo[${i}]}
.

EDIT. Sounds like you could use
Code:
MyCargo.Get[${1}].Quantity
as well. Thanks Cyber.
 
Last edited:

CyberTech

Rest in Peace
Staff member
oneoneone said:
Figured it out to an extent. There's a problem with the way
Code:
MyCargo.Get[${i}]:MoveTo[${Entity[Corporate Hangar Array].ID},${Me.Ship.Cargo[${i}].Quantity},Corporation Folder 1]
is setup.

...

EDIT. Sounds like you could use
Code:
MyCargo.Get[${1}].Quantity
as well. Thanks Cyber.
That code shouldn't be used at all. It's reliable exactly once. If you use it in a loop to move items, as soon as you move anything from or add anything to your cargo, MyCargo's index:item array and Me.Ship.Cargo array are no longer the same. Use only the MyCargo index to access item information, as you modified to do later.
 
Top Bottom