Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

welbre

Members
  • Content Count

    2
  • Joined

  • Last visited

Everything posted by welbre

  1. You need to yield the thread, use os.sleep function in while loop block.
  2. You are creating a loop without any yielding, so, the OpenOS create a exemption to break the loop and close you program. To solve this, just use os.sleep(time), where time is the time that the program will wait in the while loop. Other way is use the event api, using local event = require"event", and using event.pull("key_down"), see the event api documentation to understand tha api, the event.pull function block the loop until the "key_down" event happen. The 2 ways do the same thing, create a yielding in program thread, so the OpenOS khows that the program isn't in a no end lo
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.