nono i have a wireless remote hooked up to a wireless reciever and computer. I want it so that if they press the wireless remote quickly then it will do something but if it is held down, that it would do something else. I am just looking for some code that can find the time that the redstone signal has been active. I am also refraining from using redpower because i wanted it to be compatible with a 1.5 world when the 1.5.2 version of WR-CBE comes out. And no I'm not giving up on RedPower being released, id just prefer if it was compatible with 1.5.2 earlier
assume say redstone signal from rear of computer, try something like this:
while true do
event = os.pullEvent("redstone")
if rs.getInput("back") then
-- redstone ON event at at rear
timeStart = os.clock() -- time signal received
signalOn = true
elseif signalOn and not rs.getInput("back") then
timeEnd = os.clock()
interval = math.floor( 833300 / (timeEnd-timeStart) )
-- << Do Something , based on interval >>
signalOn = false
end -- if
end -- while
Im on my way home, so typed in how i recall coding something similar last week. Treat it as pseudocode and hopefully it gives you some ideas.
edit to add: sorry for crappy formatting and syntax. PullEvent() is cool.