Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. local xpos = 12
  2. local ypos = 10
  3. local flashtime = 0.2
  4.  
  5. mon_main = peripheral.wrap("monitor_0")
  6. mon_info = peripheral.wrap("monitor_1")
  7.  
  8. function flashred()
  9. local a = 0
  10. for i = 10,1,-1
  11. do
  12. mon_main.setBackgroundColor(colors.red)
  13. mon_main.clear()
  14. mon_main.setCursorPos(xpos,ypos)
  15. mon_main.write("-= YOU LOSE! =-")
  16. sleep(flashtime)
  17. mon_main.setBackgroundColor(colors.black)
  18. mon_main.clear()
  19. mon_main.setCursorPos(xpos,ypos)
  20. mon_main.write("-= YOU LOSE! =-")
  21. sleep(flashtime)
  22. end
  23. end
  24.  
  25. function flashgreen()
  26. local a = 0
  27. for i = 10,1,-1
  28. do
  29. mon_main.setBackgroundColor(colors.green)
  30. mon_main.clear()
  31. mon_main.setCursorPos(xpos,ypos)
  32. mon_main.write("-= YOU WIN! =-")
  33. sleep(flashtime)
  34. mon_main.setBackgroundColor(colors.black)
  35. mon_main.clear()
  36. mon_main.setCursorPos(xpos,ypos)
  37. mon_main.write("-= YOU WIN! =-")
  38. sleep(flashtime)
  39. end
  40. end
  41.  
  42. function clearall()
  43. mon_main.clear()
  44. mon_info.clear()
  45. end
  46.  
  47. clearall()
  48.  
  49. mon_main.setCursorPos(1,ypos)
  50. mon_info.setCursorPos(1,1)
  51.  
  52. mon_info.write("Slots W.I.P")
  53.  
  54. mon_main.setCursorPos(xpos,ypos)
  55. mon_main.write("-= [0] [0] [0] =-")
  56.  
  57. sleep(3)
  58.  
  59. flashred()
  60. flashgreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement