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

os.pullevent while thing?

Started by Crowdy199, 26 January 2013 - 08:16 AM
Crowdy199 #1
Posted 26 January 2013 - 09:16 AM
question i use os.pullevent all the time for cursor and bottons how do i make it so if they press e do this but dont wait for them to press e let them use the computer regulary but if they press e do this?
TheOddByte #2
Posted 26 January 2013 - 09:20 AM
What..?

event, p1 = os.pullEvent()
if event == "char" and p1 == "e" then
--Do Something
end
This What you want?
TheOddByte #3
Posted 26 January 2013 - 09:21 AM
Just some weird grammar you had there..

EDIT: Grammar Nazi On Duty! :P/>
ikke009 #4
Posted 26 January 2013 - 10:46 AM
What he means is that you can use the computer like you normally would but if "e" is pressed then something happens..
Good question though.. I dont know how to do that and the script hellkid98 posted wont work, that would freeze the computer untill "e" is pressed…
Eric #5
Posted 26 January 2013 - 10:52 AM
What do you mean by "let them use the computer regulary"?
remiX #6
Posted 26 January 2013 - 10:56 AM
You will need a big while true do loop or use parallel.waitForAny().