Advertisement
Muzze77

NewsScreen 1.0

Oct 30th, 2014
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3.  
  4. black = colors.black
  5. red = colors.red
  6. green = colors.green
  7. white = colors.white
  8. blue = colors.blue
  9. bnorm = black
  10. tnorm = white
  11. brown = colors.brown
  12. cyan = colors.cyan
  13. orange = colors.orange
  14. yellow = colors.yellow
  15. pink = colors.pink
  16. purple = colors.purple
  17.  
  18. function cbut(cx, cy, text, bcol, tcol)
  19. term.setCursorPos(cx, cy)
  20. term.setBackgroundColor(bcol)
  21. term.setTextColor(tcol)
  22. print(text)
  23. term.setBackgroundColor(bnorm)
  24. term.setTextColor(tnorm)
  25. end
  26.  
  27. cbut(3,2, "                                           ", red, black)
  28. cbut(3,3, "     Neuigkeiten in BurningKeysCity [BKC]  ", red, black)
  29. cbut(3,4, "                                           ", red, black)
  30.  
  31.  
  32. cbut(3,11, "   Rechtsklick um weiter zu scrollen       ", orange, black)
  33.            
  34.  
  35. news = {
  36. [1] = " AKW & Shop Grunstücke werden errichtet    ",
  37. [2] = " Neue GS werden angelegt                   ",
  38. [3] = " Ind. Fert. Machine wird Installiert       ",
  39. [4] = " ChestShop wird erichtet                   ",
  40. [5] = " Stadtplan wurde eingerichtet              ",
  41. [5] = " AKWs werden installiert, siehe Stadtplan  ",
  42. }
  43.  
  44. cbut(3, 6,"                                           ", blue, black)
  45. cbut(3, 7, news[1], blue, black)
  46. cbut(3, 8,"                                           ", blue, black)
  47.  
  48. nr = 1
  49. ma = table.maxn(news)
  50. ma = ma + 1
  51. function gBut(zh)
  52. cbut(3, 6,"                                     ", blue, black)
  53. cbut(3, 7, news[zh], blue, black)
  54. cbut(3, 8,"                                     ", blue, black)
  55. nr = nr + 1
  56. if nr == ma then
  57. nr = 1
  58. end
  59. end
  60.  
  61. while true do
  62. evt, side, x, y = os.pullEvent("monitor_touch")
  63. if evt == "monitor_touch" then
  64. gBut(nr)
  65.  
  66.  
  67.  
  68.  
  69.  
  70. end
  71.  
  72.  
  73.  
  74.  
  75.         end
  76. --------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement