zequan

Untitled

Jun 18th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. h = 2
  2. m = 49
  3. s = 60
  4.  
  5. function check()
  6.  
  7. if s <= 0 then
  8. m = m -1
  9. s = 60
  10. end
  11.  
  12. if m < 0 then
  13. h = h-1
  14. m = 60
  15. end
  16.  
  17. if h < 0 then
  18. print("Standing By...")
  19. redstone.setOutput("back", true)
  20. sleep(1)
  21. redstone.setOutput("back", false)
  22. sleep(300)
  23. h = 02
  24. m = 49
  25. s = 60
  26. end
  27. end
  28. while true do
  29. term.clear()
  30. term.setCursorPos(1,1)
  31. print(h..":"..m..":"..s)
  32. sleep(1)
  33. s = s-1
  34. check()
  35. end
  36.  
  37.  
  38. Just run that on the monitor B)/>
  39.  
  40. Edit: Oh and.. If someone could point out what I could do better.. That would be great :)/> I'm trying to get better.
  41.  
  42. #5 dcleondc
  43.  
  44. New Members
  45. 70 posts
  46.  
  47. Posted 02 September 2012 - 10:26 AM
  48.  
  49. View PostZoinky, on 02 September 2012 - 10:21 AM, said:
  50. I tried making one too! :)/> But, I'm not very good with lua so this is probably really bad B)/> Sorry if I did it wrong..
  51.  
  52. h = 2
  53. m = 49
  54. s = 60
  55.  
  56. function check()
  57.  
  58. if s <= 0 then
  59. m = m -1
  60. s = 60
  61. end
  62.  
  63. if m < 0 then
  64. h = h-1
  65. m = 60
  66. end
  67.  
  68. if h < 0 then
  69. redstone.setOutput("back", true)
  70. sleep(1)
  71. redstone.setOutput("back", false)
  72. sleep(300)
  73. h = 02
  74. m = 49
  75. s = 60
  76. end
  77. end
  78. while true do
  79. term.clear()
  80. term.setCursorPos(1,1)
  81. print(h..":"..m..":"..s)
  82. sleep(1)
  83. s = s-1
  84. check()
  85. end
  86.  
  87.  
  88. Just run that on the monitor B)/>
  89.  
  90. Edit: Oh and.. If someone could point out what I could do better.. That would be great :)/> I'm trying to get better.
  91. you may want to switch
  92.  
  93. if h < 0 then
  94. redstone.setOutput("back", true)
  95. sleep(1)
  96. redstone.setOutput("back", false)
  97. sleep(300)
  98. h = 02
  99. m = 49
  100. s = 60
  101. end
  102.  
  103. to
  104.  
  105. if h == 0 and m ==0 and s == 0 then
  106. redstone.setOutput("back", true)
  107. sleep(1)
  108. redstone.setOutput("back", false)
  109. sleep(300)
  110. h = 02
  111. m = 49
  112. s = 60
  113. end
Advertisement
Add Comment
Please, Sign In to add comment