factorio_onboard_computer
is a Factorio mod that provides add a board computer to your cars and write a Lua program to give them an AI.
OnBoard mod add an On-board computer
item, placed in the equipment grid of a car it gives access to an API car
\
The car API
provides these functions
car.hasPassenger()
: Return true if a player is in the carcar.getPosition()
: Returns the current position of the carcar.getSpeed()
: Return the speed of the car in km/hcar.getOrientation()
: Return the orientation of the carcar.scanSurface(position)
: Scan a position in a radius of 20 tiles, return true or false if the car will collides at and return the tile namecar.getFuel()
: Returns the fuel in the tank of the carcar.startEngine()
: Starts the car enginecar.stopEngine()
: Stop the car enginecar.accelerate()
: Press the gas pedalscar.brake()
: Press the brake pedalcar.reverse()
: Put the car into reversecar.turnRight()
: Turn the steering wheel to the rightcar.turnLeft()
: Turn the steering wheel to the leftcar.straight()
: Put back the wheels straightcar.getCargo()
: Returns the contents of the carcar.trafficInformation()
: Scan trafic in a radius of 20 tiles, return entities informationcar.getWaypoint(name)
: Find a waypoint by its name, and return its positionWhat should be done in the future: