Jump to content




Modem message event question


2 replies to this topic

#1 aaaallleex

  • New Members
  • 1 posts

Posted 28 February 2015 - 01:58 AM

When I type in "local messageArguments = {os.pullEvent("modem_message")}", the computer just stops, the flashy typing thing doesn't show anymore and I can't do anything more to the computer except to destroy it. Why does it do this, and how can I fix it?

Thanks.

#2 grand_mind1

  • Members
  • 207 posts

Posted 28 February 2015 - 02:43 AM

When os.pullEvent() is ran, the computer will wait for an event to be fired. If the fired event is the one it was passed, the compuer will continue. By running os.pullEvent("modem_message"), you are telling the computer to wait for the "modem_message" event to be fired and *then* continue on with the code. To get around this, I believe, requires the use of coroutines.
By the way, you can terminate a program with CTRL+T rather than breaking the computer.

#3 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 28 February 2015 - 07:20 AM

Here is the CC Wiki on os.pullEvent()
http://computercraft...ki/Os.pullEvent

 grand_mind1, on 28 February 2015 - 02:43 AM, said:

To get around this, I believe, requires the use of coroutines.

Well, calling just 'os.pullEvent()' with no arguments will wait for ANY event.

 aaaallleex, on 28 February 2015 - 01:58 AM, said:

I can't do anything more to the computer except to destroy it.

You can use Ctrl+t to to stop it. That literally just throws the error 'terminated' so it's possible to prevent.
If a computer really gets messed up, you can use Ctrl+r to restart it, or Ctrl+s to shut it down.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users