Guest User

Untitled

a guest
May 26th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. function startProcess(title,path,x,y,xw,yh)
  2. mainarea = window.create(desktop,x,y,xw,yh,true)
  3. titlearea = window.create(mainarea,1,1,xw,1,true)
  4. titlearea.setBackgroundColor(colors.black)
  5. titlearea.setTextColor(colors.white)
  6. titlearea.clear()
  7. titlearea.setCursorPos(2,1)
  8. titlearea.write(title)
  9. titlearea.setCursorPos(xw-3,1)
  10. titlearea.setTextColor(colors.yellow)
  11. titlearea.write(string.char(7))
  12. titlearea.setTextColor(colors.green)
  13. titlearea.write(string.char(7))
  14. titlearea.setTextColor(colors.red)
  15. titlearea.write(string.char(7))
  16. redirectarea = window.create(mainarea,1,2,xw,yh-1,true)
  17. redirectarea.setBackgroundColor(colors.white)
  18. redirectarea.setTextColor(colors.black)
  19. redirectarea.clear()
  20. redirectarea.setCursorPos(1,1)
  21. func = loadfile(path)
  22. old = func
  23. function prepend()
  24. term.redirect(redirectarea)
  25. end
  26. func = function()
  27. prepend()
  28. old()
  29. end
  30. coro = coroutine.create(func)
  31. coroutine.resume(coro)
  32. end
  33. function init()
  34. txw,tyh = term.getSize()
  35. desktop = window.create(term.current(),1,1,txw,tyh,true)
  36. desktop.setBackgroundColor(colors.cyan)
  37. desktop.clear()
  38. end
  39. init()
  40. startProcess('Login','/firefly/sys/test.lua',2,2,19,7)
Add Comment
Please, Sign In to add comment