Hi Dan,
Still working on those addons, although I have come to a snag...
I am unable to get the function "EatCloserCargoByType" to remove any weight from the cargo containers.
Heres the code:
// Load closest battery into Cargo into slot 0
// And check slot 0 status
dFullBatteryMass = 80;
switch (hUcgo.GrappleOneCargoByType("battery",0))
{
case 1:
strcpy(oapiDebugString(),"Ok Cargo Grappled Battery");
if ((hUcgo.GetCargoSlotMass(0) / dFullBatteryMass) < 0.01)
{
hUcgo.ReleaseOneCargo(0);
strcpy(oapiDebugString(),"Battery has less than 1% charge. Charge Battery before use");
}
else
{
//Charge Internal Tanks With Battery Power but leave
//less than 1% charge in battery
dBatteryEaten = ((hUcgo.GetCargoSlotMass(0) / dFullBatteryMass) - 0.009);
hUcgo.EatCloserCargoByType("battery", dBatteryEaten);
strcpy(oapiDebugString(),"Charging Internal Battery Tanks With External Battery");
}
break;
Thanks ahead of time if you can help.
JB