This project is mostly AI generated, so please do expect some bugs and whatnot.
This project automates British Railway, a Roblox train simulation game.
- Finds the most optimal route. (points per minute)
- Sticks to speed limit.
- Acknowledge AWS Warnings.
- Open and close doors.
- Can move forward if train is not fully in station.
- Utilizes analog brake and throttle.
- It does NOT have guard capabilities.
- It does NOT obey danger aspects. Therefore it only works on PRIVATE SERVERS
- It does NOT stop at car markers, however it will nudge forward if the train's not fully in the platform.
- It does NOT know what to do when Roblox crashes.
- Stop at markers
- Set to seperate throttle and brake
- Python 3.x
pytesseract
for OCR functionalityopencv-python
for image processingpyautogui
for taking screenshots and simulating mouse clickskeyboard
for simulating keyboard inputs- Tesseract-OCR installed on your system
Open your terminal and run the following command to clone the repository:
git clone https://github.com/yourusername/train-control-automation.git
cd train-control-automation
Ensure you have pip
installed, then run this command:
pip install pyautogui
pip install pytesseract
pip install keyboard
pip install Pillow
- Download the installer from Tesseract at UB Mannheim.
- Install it and note the installation path (e.g.,
C:\Program Files\Tesseract-OCR
). - Add the Tesseract installation path to your system's PATH environment variable.
Use Homebrew to install Tesseract:
brew install tesseract
Install Tesseract using the package manager:
sudo apt-get install tesseract-ocr
If Tesseract is not in your system's PATH, set its path in your script:
In drive.py
and menu.py
, add the following line:
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' # Update with your path
Open config.py
and set the pixel positions and parameters according to your application’s UI layout. Make sure to adjust values like drivePos
, loadConsistPos
, and other portions to match the actual coordinates on your screen.
-
Start the Application: Run the main script:
python main.py
-
Control the Automation:
- Press
s
to start the train control process. - Press
e
to stop the automation at any time.
- Press
-
Monitor Output: The program will log its actions in the console. Check for any errors or required adjustments based on your screen's response.
config.py
: Contains configuration variables such as pixel positions and control parameters.menu.py
: Handles interactions with the application’s menu, including clicking buttons and taking screenshots.drive.py
: Manages the train control logic, including reading distances, speeds, and speed limits.main.py
: The entry point that starts the automation process and manages user input for starting and stopping the automation.
This project is licensed under the MIT License. See the LICENSE file for details.