Advertisement
SemlerPDX

Minecraft ComputerCraft BannerClock

Aug 6th, 2021
1,536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.13 KB | None | 0 0
  1. --startup for banner display
  2. --by SemlerPDX Aug-05-2021 13:18
  3.  
  4. displaySide = "back"
  5. motdVG1 =    "      VETERANS-GAMING"
  6. motdVG2 =    "GOOD PEOPLE - GREAT TEAM PLAY"
  7. textSize = 1
  8. interval = 0.83
  9.  
  10. motd6to9 =   "      Good Morning VG!"
  11. motd9to12 =  "   Daylight's burning guys!"
  12. motd12to14 = "  Time for Lunchy Munchies!"
  13. motd14to18 = "    Work smart not hard"
  14. motd18to21 = " the sun is getting real low"
  15. motd21to6 =  "   watch out!  behind you!"
  16.  
  17. local randM = 0
  18. local randH = 15
  19. local randF = 30
  20.  
  21. function fClearSet()
  22.   monitor.clear()
  23.   monitor.setCursorPos(1,1)
  24. end
  25.  
  26. function fRandy()
  27.   t = os.time()
  28.   if t>=6.001 and t<=9 then
  29.     monitor.setTextColor(colors.orange)
  30.     motd = motd6to9
  31.   elseif t>=9.001 and t<=12 then
  32.     monitor.setTextColor(colors.yellow)
  33.     motd = motd9to12
  34.   elseif t>=12.001 and t<=14 then
  35.     monitor.setTextColor(colors.green)
  36.     motd = motd12to14
  37.   elseif t>=14.001 and t<=18 then
  38.     monitor.setTextColor(colors.yellow)
  39.     motd = motd14to18
  40.   elseif t>=18.001 and t<=21 then
  41.     monitor.setTextColor(colors.orange)
  42.     motd = motd18to21
  43.   elseif t>21.001 or t<=6 then
  44.     monitor.setTextColor(colors.red)
  45.     motd = motd21to6
  46.   else
  47.     motd = "time is space"
  48.   end
  49.   if randM >= randH then
  50.     motdVG = motdVG2
  51.   else
  52.     motdVG = motdVG1
  53.   end
  54.   if randM >= randF then
  55.     randM = 0
  56.   end
  57. end
  58.  
  59. monitor = peripheral.wrap(displaySide)
  60. fClearSet()
  61. monitor.setTextScale(textSize)
  62. monitor.setBackgroundColor(colors.black)
  63.  
  64. function mPrint(text, y)
  65.   monitor.setCursorPos(1, y)
  66.   monitor.write(text)
  67. end
  68.  
  69. while true do
  70.   sleep(interval)
  71.   fClearSet()
  72.   randM = randM + 1
  73.   nDay = os.day()
  74.   nTime = os.time()
  75.   motdDays = "   Day " .. nDay .. " on VG Minecraft!"
  76.   motdTime = " Local world time is " .. textutils.formatTime(nTime, false)
  77.  
  78.   --world days line 1
  79.   monitor.setTextColor(colors.yellow)
  80.   mPrint(motdDays, 1)
  81.   --world time line 2
  82.   monitor.setTextColor(colors. blue)
  83.   mPrint(motdTime, 2)
  84.   --random clan name line 3
  85.   fRandy()
  86.   monitor.setTextColor(colors.yellow)
  87.   mPrint(motdVG, 3)
  88.   --random message line 5
  89.   fRandy()
  90.   mPrint(motd, 5)
  91. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement