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

    • Lizzy Trickster

      Latest Stable OpenComputers Version   11/26/16

      The latest released version of OpenComputers is version 1.7.2 for MC 1.7.10, 1.10.2, 1.11.2 & 1.12.2. See more information here! Beta/Dev builds can be found at the Jenkins Build Server (ci.cil.li)
  • 0

thread question #2


i don't know if this is even possible but what i am trying to do is this


NOTE: that is know that useing a thread in this scene is 100% Unnecessary but remeber this is a simple test


thread = require "thread"

e = require "event"


running = true


t = thread.create(function()



-- i know that i can put a os.exit() here but the thing is to try to get this to work

running = false --<< that



while running do

  --some random thing to run a io.read() will be a good combo


  print( "you said: "..io.read() )




so this ends the thread as inspected but does not end the loop my guess is that all things in the thread function is local only but what can i then do to update the "running" value in the global process aka in the while loop???


all help will be great



Share this post

Link to post
Share on other sites

6 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now