This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
poppa_j7213's profile picture

redstone imput timer

Started by poppa_j7213, 19 December 2012 - 08:23 AM
poppa_j7213 #1
Posted 19 December 2012 - 09:23 AM
i am using an eu detector cable to send an redstone current to a computer. in which i want to create a program that keeps track of how long the imput is on for, when the imput goes away i want the timer to pause untill another imput is present. then it could keep track of how long the imput was on over a period of time. example figuring out how long someone spent standing on a pressure plate over a day. im planning on using this for an industrialcraft power meter to see how long someone draws power from my plant. any help would be greatly appreciated
etopsirhc #2
Posted 19 December 2012 - 09:42 AM
the easiest way ( that i know of ) would probably be the os.pullEvent on redstone , then when the event is triggered get the system time . and after its turned on then off again you subtract the 1st time from the second getting the time spent . that said , their may be a timer thing that i dont know of :P/>
ChunLing #3
Posted 19 December 2012 - 12:35 PM
Easiest way is the best way.