Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function startProcess(title,path,x,y,xw,yh)
- mainarea = window.create(desktop,x,y,xw,yh,true)
- titlearea = window.create(mainarea,1,1,xw,1,true)
- titlearea.setBackgroundColor(colors.black)
- titlearea.setTextColor(colors.white)
- titlearea.clear()
- titlearea.setCursorPos(2,1)
- titlearea.write(title)
- titlearea.setCursorPos(xw-3,1)
- titlearea.setTextColor(colors.yellow)
- titlearea.write(string.char(7))
- titlearea.setTextColor(colors.green)
- titlearea.write(string.char(7))
- titlearea.setTextColor(colors.red)
- titlearea.write(string.char(7))
- redirectarea = window.create(mainarea,1,2,xw,yh-1,true)
- redirectarea.setBackgroundColor(colors.white)
- redirectarea.setTextColor(colors.black)
- redirectarea.clear()
- redirectarea.setCursorPos(1,1)
- func = loadfile(path)
- old = func
- function prepend()
- term.redirect(redirectarea)
- end
- func = function()
- prepend()
- old()
- end
- coro = coroutine.create(func)
- coroutine.resume(coro)
- end
- function init()
- txw,tyh = term.getSize()
- desktop = window.create(term.current(),1,1,txw,tyh,true)
- desktop.setBackgroundColor(colors.cyan)
- desktop.clear()
- end
- init()
- startProcess('Login','/firefly/sys/test.lua',2,2,19,7)
Add Comment
Please, Sign In to add comment