Posted 10 February 2013 - 07:01 AM
                So I'm trying to using parallel.waitForAny( shell.run('program'), FunctionToReturnWhenAKeyIsPressed ) but it isn't working…
Example:
Main Program:
Program 'a':
Clicking up does nothing, and when i is 10, it does stop with this error:
parallel:4: bad argument, function expected, got boolean
the shell.run('a') returns false when it returns but why isn't clicking the up arrow working?
                
            Example:
Main Program:
function test()
	while true do
		_, k = os.pullEvent("key")
		if k == keys.up then return end
	end
end
parallel.waitForAny(shell.run('a'), test )Program 'a':
i = 1
while true do
	term.setBackgroundColour( 2^(math.random(1, 15)) )
	term.clear()
	i = i + 1
	sleep(1)
	if i == 10 then break end
endClicking up does nothing, and when i is 10, it does stop with this error:
parallel:4: bad argument, function expected, got boolean
the shell.run('a') returns false when it returns but why isn't clicking the up arrow working?
 
         
                