Posted 16 March 2012 - 02:14 AM
I'm trying to write to a monitor as well as the screen at the same time but when I call coroutine.create(myDrawFunction()) it doesn't run simultaneously.
Call my function:
My function:
Call my function:
local monitor = coroutine.create(misc.writeMonitor)
coroutine.resume(monitor)
My function:
function writeMonitor()
local sides = {
"top",
"bottom",
"left",
"right",
"front",
"back"
}
local validSide = ""
for i = 1, table.getn(sides) do
if peripheral.getType(sides[i]) == "monitor" then
validSide = sides[i]
break
end
end
if validSide ~= "" then
local monitor = peripheral.wrap(validSide)
while true do
pcall(sleep, 0.1)
screen.drawFullBorder(monitor)
end
end
end