KingofGamesYami, on 22 June 2015 - 03:55 AM, said:
That should work perfectly - if you touch the monitor anywhere from (2,2) to (9,2). I'd guess you have it in a loop, and something happening after this redraws something different before you pull another event. Something like this:
Notice that even if you press spacebar, nothing appears to happen. In reality, the terminal is being cleared, but the text is redrawn before you can see the effects of clear.
while true do term.setCursorPos( 1, 1 ) term.write( "Hello World" ) local event = {os.pullEvent()} if event[ 1 ] == "key" and event[ 2 ] == keys.space then term.clear() end end
Notice that even if you press spacebar, nothing appears to happen. In reality, the terminal is being cleared, but the text is redrawn before you can see the effects of clear.
OH! That makes sense, so it probably is turning it the lime green, but when it hits the "end" it starts the program again?
Is there a simple way to halt the program so that it just waits for another button to be pushed instead of re-writting out the terms to the monitor?