Coti5432

Coti Logo Screen

Mar 5th, 2021 (edited)
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.58 KB | None | 0 0
  1. -- Logo by Coti5432
  2. -- Make sure computer is under monitor
  3. -- Monitor should be 7x3
  4. mWidth = 0
  5. mHeight = 0
  6.  
  7. mon=peripheral.wrap('top')
  8. mon.setTextScale(2)
  9. mon.clear()
  10.  
  11. mon.setCursorPos(10,3)
  12. mon.setBackgroundColor(colors.blue)
  13. mon.write("                 ")
  14.  
  15. --display name
  16. mon.setCursorPos(10,4)
  17. mon.write(" ")
  18. mon.setBackgroundColor(colors.lightBlue)
  19. mon.write("   ")
  20. mon.setBackgroundColor(colors.blue)
  21. mon.write(" ")
  22. mon.setBackgroundColor(colors.lightBlue)
  23. mon.write("   ")
  24. mon.setBackgroundColor(colors.blue)
  25. mon.write(" ")
  26. mon.setBackgroundColor(colors.lightBlue)
  27. mon.write("   ")
  28. mon.setBackgroundColor(colors.blue)
  29. mon.write(" ")
  30. mon.setBackgroundColor(colors.lightBlue)
  31. mon.write("   ")
  32. mon.setBackgroundColor(colors.blue)
  33. mon.write(" ")
  34.  
  35. mon.setCursorPos(10,5)
  36. mon.write(" ")
  37. mon.setBackgroundColor(colors.lightBlue)
  38. mon.write(" ")
  39. mon.setBackgroundColor(colors.blue)
  40. mon.write("   ")
  41. mon.setBackgroundColor(colors.lightBlue)
  42. mon.write(" ")
  43. mon.setBackgroundColor(colors.blue)
  44. mon.write(" ")
  45. mon.setBackgroundColor(colors.lightBlue)
  46. mon.write(" ")
  47. mon.setBackgroundColor(colors.blue)
  48. mon.write("  ")
  49. mon.setBackgroundColor(colors.lightBlue)
  50. mon.write(" ")
  51. mon.setBackgroundColor(colors.blue)
  52. mon.write("   ")
  53. mon.setBackgroundColor(colors.lightBlue)
  54. mon.write(" ")
  55. mon.setBackgroundColor(colors.blue)
  56. mon.write("  ")
  57.  
  58. mon.setCursorPos(10,6)
  59. mon.write(" ")
  60. mon.setBackgroundColor(colors.lightBlue)
  61. mon.write("   ")
  62. mon.setBackgroundColor(colors.blue)
  63. mon.write(" ")
  64. mon.setBackgroundColor(colors.lightBlue)
  65. mon.write("   ")
  66. mon.setBackgroundColor(colors.blue)
  67. mon.write("  ")
  68. mon.setBackgroundColor(colors.lightBlue)
  69. mon.write(" ")
  70. mon.setBackgroundColor(colors.blue)
  71. mon.write("  ")
  72. mon.setBackgroundColor(colors.lightBlue)
  73. mon.write("   ")
  74. mon.setBackgroundColor(colors.blue)
  75. mon.write(" ")
  76.  
  77. mon.setCursorPos(10,7)
  78. mon.write("                 ")
  79.  
  80. mon.setCursorPos(1,1)
  81. mon.setBackgroundColor(colors.black)
  82.  
  83. --test if middle of O is clicked
  84. function checkClickPosition()
  85.     if mWidth == 16 and mHeight == 5 then
  86.          shell.run("main")
  87.     end
  88. end
  89.  
  90. repeat
  91.   event,p1,p2,p3 = os.pullEvent()
  92.   -- this line tells the computer to wait until
  93.   -- an event happens. We are waiting for a
  94.   -- touchscreen event
  95.  
  96.    if event=="monitor_touch" then
  97.    -- this checks to see if the event was a
  98.    -- touchscreen event
  99.    
  100.      mWidth = p2 -- sets mouseWidth
  101.      mHeight = p3 -- and mouseHeight
  102.      checkClickPosition() -- this runs our function
  103.      
  104.    end
  105.    -- the end of the "if loop".
  106.    
  107.    
  108. until event=="char" and p1==("x")
Add Comment
Please, Sign In to add comment