Jump to content




[Solved] os.pullEventRaw not working with parallel


  • You cannot reply to this topic
4 replies to this topic

#1 darkrising

  • Members
  • 234 posts
  • LocationScotland

Posted 11 May 2013 - 05:15 AM

Hi all I've noticed on CC 1.5+ that os.pullEventRaw or pcall don't work when calling the parallel api functions, a few of my programs are using pcall but I've had to implement a loop that listens for the control key to stop people [Ctrl] + T out of the program. Its not the most elegant way of doing things but it works.

Is there a better way of doing this? and also is the [Ctrl] like key on a mac a different id? (I don't use mac)

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth Africa

Posted 11 May 2013 - 06:08 AM

Small exampe?

#3 darkrising

  • Members
  • 234 posts
  • LocationScotland

Posted 11 May 2013 - 08:31 AM

function one()
while true do
--does stuff
end
end

function two()
while true do
--also does stuff
-- maybe login stuff too
end
end

pcall(parallel.waitForAll(one, two))

Quick example

#4 LBPHacker

  • Members
  • 766 posts
  • LocationBudapest, Hungary

Posted 11 May 2013 - 11:24 AM

That pcall will try to run the function returned by .waitForAll. Try
pcall(parallel.waitForAll, one, two)


#5 darkrising

  • Members
  • 234 posts
  • LocationScotland

Posted 11 May 2013 - 11:54 AM

Oh I see what I've done wrong now, I forgot to pass them as arguments... *derp*

Thanks for your help!





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users