Advertisement
Guest User

desktop.app

a guest
May 30th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. --Loading desktop
  2. background = paintutils.loadImage("desktop.png")
  3. paintutils.drawImage(background, 1, 1)
  4. function scp(x, y)
  5. term.setCursorPos(x, y)
  6. end
  7. function sbc(color)
  8. term.setBackgroundColor(color)
  9. end
  10. function stc(color)
  11. term.setTextColor(color)
  12. end
  13. scp(1, 19)
  14. sbc(colors.green)
  15. write("Start")
  16. sbc(colors.blue)
  17. write("                                              ")
  18.  
  19. --Buttons API
  20. running = true
  21. while running do
  22. local e, b, x, y = os.pullEvent("mouse_click")
  23. if x>=1 and x<=5 and y==19 then
  24. shell.run("start.app")
  25. running = false
  26. end
  27. if x>=2 and x<=6 and y>=2 and y<=5 then
  28. shell.run("sleep.app")
  29. running = false
  30. end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement