Coti5432

Coti Main Screen

Mar 5th, 2021 (edited)
904
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- Main screen for Coti5432
  2.  
  3. mWidth = 0
  4. mHeight = 0
  5.  
  6. mon = peripheral.wrap('top')
  7. mon.setTextScale(1) -- Res 71x19
  8. mon.clear()
  9.  
  10. -- start border
  11. mon.setCursorPos(3,2)
  12. mon.setBackgroundColor(colors.lime)
  13. mon.write("                                                                  ")
  14. mon.setCursorPos(3,3)
  15. mon.write(" ")
  16. mon.setCursorPos(3,4)
  17. mon.write(" ")
  18. mon.setCursorPos(3,5)
  19. mon.write(" ")
  20. mon.setCursorPos(3,6)
  21. mon.write(" ")
  22. mon.setCursorPos(3,7)
  23. mon.write(" ")
  24. mon.setCursorPos(3,8)
  25. mon.write(" ")
  26. mon.setCursorPos(3,9)
  27. mon.write(" ")
  28. mon.setCursorPos(3,10)
  29. mon.write(" ")
  30. mon.setCursorPos(3,11)
  31. mon.write(" ")
  32. mon.setCursorPos(3,12)
  33. mon.write(" ")
  34. mon.setCursorPos(3,13)
  35. mon.write(" ")
  36. mon.setCursorPos(3,14)
  37. mon.write(" ")
  38. mon.setCursorPos(3,15)
  39. mon.write(" ")
  40. mon.setCursorPos(3,16)
  41. mon.write(" ")
  42. mon.setCursorPos(3,17)
  43. mon.write(" ")
  44. mon.setCursorPos(3,18)
  45. mon.write("                                                                  ")
  46. mon.setCursorPos(68,3)
  47. mon.write(" ")
  48. mon.setCursorPos(68,4)
  49. mon.write(" ")
  50. mon.setCursorPos(68,5)
  51. mon.write(" ")
  52. mon.setCursorPos(68,6)
  53. mon.write(" ")
  54. mon.setCursorPos(68,7)
  55. mon.write(" ")
  56. mon.setCursorPos(68,8)
  57. mon.write(" ")
  58. mon.setCursorPos(68,9)
  59. mon.write(" ")
  60. mon.setCursorPos(68,10)
  61. mon.write(" ")
  62. mon.setCursorPos(68,11)
  63. mon.write(" ")
  64. mon.setCursorPos(68,12)
  65. mon.write(" ")
  66. mon.setCursorPos(68,13)
  67. mon.write(" ")
  68. mon.setCursorPos(68,14)
  69. mon.write(" ")
  70. mon.setCursorPos(68,15)
  71. mon.write(" ")
  72. mon.setCursorPos(68,16)
  73. mon.write(" ")
  74. mon.setCursorPos(68,17)
  75. mon.write(" ")
  76.  
  77. --Back Arrow
  78. mon.setCursorPos(1,19)
  79. mon.setTextColor(colors.white)
  80. mon.setBackgroundColor(colors.black)
  81. mon.write("<")
  82.  
  83. mon.setBackgroundColor(colors.black)
  84.  
  85. --Turtles
  86. mon.setCursorPos(5,4)
  87. mon.setTextColor(colors.red)
  88. mon.write("Turtles")
  89.  
  90. --Touch Screen
  91. function checkClickPosition()
  92.     if mWidth == 1 and mHeight == 19 then -- Back Arrow
  93.          shell.run("logo")
  94.        
  95.     elseif mWidth >= 5 and mWidth <= 12 and mHeight == 4 then
  96.         shell.run("logo")
  97.     end
  98. end
  99.  
  100. repeat
  101.   event,p1,p2,p3 = os.pullEvent()
  102.   -- this line tells the computer to wait until
  103.   -- an event happens. We are waiting for a
  104.   -- touchscreen event
  105.  
  106.    if event=="monitor_touch" then
  107.    -- this checks to see if the event was a
  108.    -- touchscreen event
  109.    
  110.      mWidth = p2 -- sets mouseWidth
  111.      mHeight = p3 -- and mouseHeight
  112.      checkClickPosition() -- this runs our function
  113.      
  114.    end
  115.    -- the end of the "if loop".
  116.    
  117.    
  118. until event=="char" and p1==("x")
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×