When wrapping the thread function in createThread it seems to me the possible arguments are lost and not transfered to the thread function, I suspect the:
local wrapped = function (...) coroutine.yield(); func(...); end; -- NOTE: "..." in func argument
local co = coroutine.create(wrapped);
local status, err = coroutine.resume(co, ...);
local function thread(num)
for i = 1,10 do
print("Test: ", num);
coroutine.yield();
end
end
createThread("test2", thread, 1234);
-- Creates a thread that will continually print out "Test: 1234" 10 times then kill itself.
function main()
while(true) do
yrest(1);
end
end
startMacro(main, true);
Edit: This hasn't actually been officially released. It's in the changelog for 1.04, which has a number of improvements but is still far off from a release.