Skip to content
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

Add a command that can check an variable's equation with another constant or variable #17

Open
fredongit opened this issue Aug 29, 2024 · 1 comment

Comments

@fredongit
Copy link

I want to make an PIS screen that can show the earliest train's predicted arrival time in a station with the help of TrainCarts.
But, when a train triggers the trigger sign, the value of the variable (of the platform of the station) would change to the predicted arrival time of the train, which is the predicted arrival time of the latest train that had triggered the sign.
I don't have any ideas about it.
If there is a command that can check an variable's equation with another constant or variable, then it will be much better, not only the PIS screen, but also something else.
So, in this example, if the variable is equal to 00:00:00, then we can update the variable. Otherwise, we can't update it.

@bergerkiller
Copy link
Member

bergerkiller commented Aug 29, 2024

You can put variables inside variables, with /var edit name set %triggervariable%. That can be put in a command block. Would it be possible to use that mechanism to toggle which variable is shown, or to replace the text with a constant?

Kind of a difficult issue to fix, so I'm just giving suggestions.

I also think the trigger sign accepts redstone input, so maybe with some sort of timer you can add a debounce to it? So if it was triggered recently in the past it doesn't activate. Could also be done with a detector sign, disabling the trigger sign if another train is up ahead already.

Possibly all of that combined with two trigger signs. One used when there is no train ahead, another when there is. And toggling between the two using the set %name% command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants