Skip to content

Add ComputerCraft Lua functions to retrieve train information from the station #8491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: mc1.20.1/dev
Choose a base branch
from

Conversation

ajh123
Copy link

@ajh123 ajh123 commented May 15, 2025

This PR adds new functions to the Train Station Peripheral including:

  • getPresentTrain()
  • getImminentTrain()
  • getEnrouteTrain()

These functions returns the full train information inside a Lua table, or nill if a train is not found.

This would be usefull to create custom displays using CC monitors, announcements using CC's speakers, or a custom train tracking app on a Pocket Computer.

Related discussion: #7453 (comment) #7453 (comment) #7453 (comment)

@VoidLeech VoidLeech added the pr type: feature PR adds a new feature or changes an existing feature label May 15, 2025
@tizu69
Copy link

tizu69 commented May 17, 2025

this is very neat. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr type: feature PR adds a new feature or changes an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants