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

[(?) to 1.5+] queueEvent doesn't work before yield/pullEvent

Started by Pinkishu, 03 March 2013 - 01:33 AM
Pinkishu #1
Posted 03 March 2013 - 02:33 AM
ComputerCraft Version Information:
Tested in SSP using CC 1.5 and CC 1.51pr3 and used ccEmu to test too. (MC 1.4.7)

Description of Bug:
If you call queueEvent before the first pullEvent, the event queue'd doesn't seem to pop up anywhere.

Steps to Reproduce Bug:
Make a startup file

os.queueEvent("AA")
while true do
  local evData = {os.pullEventRaw()} --coroutine.yield doesn't work either
  print(textutils.serialize(evData))
end

You'll not see an "AA" event popping up but if you hit keys you'll see the key events.
If you however name the file something else or run it manually (not right on startup) it'll get the AA event
it'll also get the AA event if you do:


os.pullEventRaw()
os.queueEvent("AA")
while true do
  local evData = {os.pullEventRaw()}
  print(textutils.serialize(evData))
end
which means the issue is not calling pullEventRaw first? not sure
KaoS #2
Posted 05 March 2013 - 01:29 AM
I had a similar issue where I could not manually queue an event from within 3 if statements in a for loop, I asked others to test the code and it worked for them so I created a new MC world save and it worked fine (my own fault for messing with my world). try it on a new save
Pinkishu #3
Posted 05 March 2013 - 04:18 AM
I had a similar issue where I could not manually queue an event from within 3 if statements in a for loop, I asked others to test the code and it worked for them so I created a new MC world save and it worked fine (my own fault for messing with my world). try it on a new save

It didntt work in ccEmu, didn't work in MC and didn't work for the person who i helped debugging their problem ^^
remiX #4
Posted 05 March 2013 - 07:21 AM
Works for me… tested with latest version of CCEmu

[attachment=1042:s.PNG]

(Used the very first code you supplied)
Cloudy #5
Posted 05 March 2013 - 07:36 AM
Rename that startup and try on bootup.
Pinkishu #6
Posted 05 March 2013 - 01:13 PM
Works for me… tested with latest version of CCEmu

[attachment=1042:s.PNG]

(Used the very first code you supplied)

As cloudy said, rename it to startup, it only happens of os.queueEvent is called before the first os.pullEvent, by them time you type stuff into the shell, the shell already pulls events