MysticT, on 05 July 2012 - 04:47 PM, said:
It doesn't really matter wich loop you use (altough while is normally used for infinite loops). The important thing is to have os.pullEvent("redstone"), since it will make the program just send the input when there's a change in redstone, so it doesn't loop all the time consuming you cpu time. If you want it to be able to stand on a pressure plate and have it send repeated key presses, then you should use a timer/sleep, like this:
local function pad() while true do -- check all the inputs sleep(0.5) -- you can change the time, so it checks more often end end
I did actually have it like this once, had a 0.2 sec timer, because without it, or any lower it flooded the parallel api and caused it to error out...
I have it working nice now though!











