with the multitasking api you can run programs or functions on the background. i am working on a version that you can switch between programs with keys( maybe like crtl+tab? ) the game freezes when you switch to another one. the current version is made to be intergrated in an OS. of cource you can use it your own but i havent found much use for it.
if you are going to sell this on a server or just post it randomly on the internet i am fine with that but i WANT credits for the multitasking API
that was rule number 1 the second rule is that you should never run an program on the background that is printing stuff out. if it does its going to mess the screen up.
here is the code: http://pastebin.com/2yYLywGK
and if you just want to have the pastebin code:
pastebin get 2yYLywGK multitask
if you want the user control program( no credits needed, status and terminate not working ):
the source code: http://pastebin.com/KZA7NR4P
and the pastebin command:
pastebin get KZA7NR4P proces
how to use:
if you want to start the shell as main thread then just do the following
proces start
multitask.start( true )
the first argument on multitask.start( ) is if you want to start the shellproces start does the same but it uses the userfriendly control program
a list of other functions in the API:
multitask.run( ) --dont use this guy, if you want to use it you have to know what you are doing
multitask.fileToFunction( sFile ) --returns a function that runs the program you used as first argument
multitask.runShell( ) --basicly runs the shell
multitask.create( function ) --this creates a new thread that will be executed when calling run() you dont use it like this: create( helloWorld( ) ), but kile this: create( helloWord )
multitask.runProgram( sFile ) --this uses the fileToFunction function to create a thread out of a file
multitask.start( bStartShell ) --starts running and starts shell depending on the first argument
let me know what you think in the comments and/or in the poll