Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. local xpos = 12
  2. local ypos = 10
  3. local flashtime = 0.4
  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. mon_main.clear()
  24. end
  25.  
  26. function flashgreen()
  27. local a = 0
  28. for i = 10,1,-1
  29. do
  30. mon_main.setBackgroundColor(colors.green)
  31. mon_main.clear()
  32. mon_main.setCursorPos(xpos,ypos)
  33. mon_main.write("-= YOU WIN! =-")
  34. sleep(flashtime)
  35. mon_main.setBackgroundColor(colors.black)
  36. mon_main.clear()
  37. mon_main.setCursorPos(xpos,ypos)
  38. mon_main.write("-= YOU WIN! =-")
  39. sleep(flashtime)
  40. end
  41. mon_main.clear()
  42. end
  43.  
  44. function clearall()
  45. mon_main.clear()
  46. mon_info.clear()
  47. end
  48.  
  49. clearall()
  50.  
  51. mon_main.setCursorPos(1,ypos)
  52. mon_info.setCursorPos(1,1)
  53.  
  54. mon_info.write("Slots W.I.P")
  55.  
  56. mon_main.setCursorPos(xpos,ypos)
  57. mon_main.write("-= [0] [0] [0] =-")
  58.  
  59. sleep(3)
  60.  
  61. flashred()
  62. flashgreen()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement