Hi All,
I have an idea I need help with I like to add a counter to this that goes up by 1 every time the script is run then rest at midnight every day
thanks for any help
Have i idea not sure how to add a counter
Just define a “run count” variable and increase it each time the piston runs.
Rest until when?
@Pantheon I do have one question in the code i posted above where would you put the if for the reset in there ?
Thanks
I have not tested this. But I don’t think that it matters where you put the counter or the reset. Realize that this piston will run every night at midnight and reset the Piston_Count to 0. But then immediately after that the Piston_Count will be set to 1 because it just ran. So each day, your Piston_Count will always be at least 1. Each time one of your IF triggers is triggered will also add 1 to the Piston_Count because the piston will always execute from top to bottom. You can adjust the logic if you do not want to add 1 to the Piston_Count at midnight.
@Pantheon the way that if is worded would it reset the first time the script is run after the time
as the script is not run daily?
The piston that I posted will run at least once a day at midnight and will reset the Piston_Count each night at midnight. Isn’t that what you wanted? Did that answer your question?