|
@@ -43,6 +43,25 @@ def main() -> None:
|
|
|
materials = {mat['Ticker']: mat for mat in raw_materials}
|
|
materials = {mat['Ticker']: mat for mat in raw_materials}
|
|
|
|
|
|
|
|
optimal, from_cx = calculate_optimal(planets, materials, args.weight, args.volume)
|
|
optimal, from_cx = calculate_optimal(planets, materials, args.weight, args.volume)
|
|
|
|
|
+
|
|
|
|
|
+ weight_used = volume_used = 0
|
|
|
|
|
+ for mat, amount in from_cx.items():
|
|
|
|
|
+ weight_used += amount * materials[mat]['Weight']
|
|
|
|
|
+ volume_used += amount * materials[mat]['Volume']
|
|
|
|
|
+ for planet in planets:
|
|
|
|
|
+ unload = optimal[planet.name]
|
|
|
|
|
+ for mat, amount in unload.items():
|
|
|
|
|
+ weight_used -= amount * materials[mat]['Weight']
|
|
|
|
|
+ volume_used -= amount * materials[mat]['Volume']
|
|
|
|
|
+ for mat in planet.exporting:
|
|
|
|
|
+ amount = planet.inventory.get(mat, 0)
|
|
|
|
|
+ weight_used += amount * materials[mat]['Weight']
|
|
|
|
|
+ volume_used += amount * materials[mat]['Volume']
|
|
|
|
|
+ if weight_used > args.weight:
|
|
|
|
|
+ print(f'\033[33mwarning:\033[0m need additional {weight_used - args.weight:.1f}t to pick up exports at {planet.name}')
|
|
|
|
|
+ if volume_used > args.volume:
|
|
|
|
|
+ print(f'\033[33mwarning:\033[0m need additional {volume_used - args.volume:.1f}㎥ to pick up exports at {planet.name}')
|
|
|
|
|
+
|
|
|
print(cyan('\nload at CX:\n') + json.dumps({
|
|
print(cyan('\nload at CX:\n') + json.dumps({
|
|
|
'actions': [
|
|
'actions': [
|
|
|
{'name': 'BuyItems', 'type': 'CX Buy', 'group': 'A1', 'exchange': 'IC1',
|
|
{'name': 'BuyItems', 'type': 'CX Buy', 'group': 'A1', 'exchange': 'IC1',
|