awsumben13, on 05 January 2013 - 09:48 AM, said:
how does the multitasking work...i want to add an easy multitasking library into something im making but im not sure how to :l
You can use code of my Taskforce program for multitasking:
Copy the api called 'grab'
local task = grab.createProcessor()
-- Makes a new 'eventprocessor'.
task.execute = function(...)
-- Do stuff
rs.setOutput("left",true)
end
-- Define function
-- Execute is called on every event
-- The argument is the event
-- You can make multiple task by making more task via grab.createProcessor()
-- Call go to start pulling events. Press CRTL+T for one second to stop.
grab.go()
You can also use grabroutine.run(function() print("herpaderp") end).
That allows you to use os.pullEvent as normal.
I havent tested the code so far, so there could be errors in it.
If you have questions just ask them
EDIT: I have added 'grab' to the API documentation of Taskforce











