JackHopkins / PaperclipMaximiser

A Paperclip Maximiser in Factorio to evaluate instrumental convergence in LLMs.
3 stars 0 forks source link

Connecting pipes issue #64

Open MartBakler opened 6 days ago

MartBakler commented 6 days ago

CODE

from factorio_instance import *
"""
Step 1: Place the offshore pump at the water source
"""
# Move to the water source
water_source = Position(x=-40.5, y=-41.5)
move_to(water_source)
print(f"Moved to water source at {water_source}")
# Place the offshore pump
pump = place_entity(Prototype.OffshorePump, Direction.UP, water_source)
print(f"Placed offshore pump at {pump.position}")
"""
Step 2: Place the boiler and connect it to the pump
"""
# Calculate position for the boiler (4 tiles away from the pump)
boiler_position = Position(x=pump.position.x + 4, y=pump.position.y)

# Move to the calculated position
move_to(boiler_position)
print(f"Moved to boiler position at {boiler_position}")

# Place the boiler
boiler = place_entity(Prototype.Boiler, Direction.UP, boiler_position)
print(f"Placed boiler at {boiler.position}")

# Connect the pump to the boiler with pipes
pump_to_boiler_pipes = connect_entities(pump, boiler, Prototype.Pipe)
assert pump_to_boiler_pipes, "Failed to connect pump to boiler with pipes"
print("Connected pump to boiler with pipes")

OUTPUT image