Posted 09 January 2015 - 08:43 PM
I'm writing the OS with windows and multitasking. How to run the 2 or more programs at once! I know that uses the coroutines, but how to use the coroutines with program?
I tried that one time, but when i ran it, it errors all of the custom functions… I'm using the public functions.
There's the code:
tpr(text,x,y) - Print text in specific coordinates
The file with functions is already ran.
It errors all of the custom functions within the coroutine.
Please help with that.
I tried that one time, but when i ran it, it errors all of the custom functions… I'm using the public functions.
There's the code:
fil = fs.open("testProgram","r")
text = fil.readLine()
fil.close()
local func,err = loadstring(text)
local con = coroutine.create(func)
while true do
tpr("lool",1,1)
con.resume()
sleep(0.1)
end
tpr(text,x,y) - Print text in specific coordinates
The file with functions is already ran.
It errors all of the custom functions within the coroutine.
Please help with that.
Edited on 10 January 2015 - 06:58 AM