Advertisement
Telerabi

Reklame Computer

Jun 27th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. p = 0
  2. print("Anzahl Monitore [Horizontal]:")
  3. anzahlMon = tonumber(read())
  4. print("Anzuzeigender Text:")
  5. text = read()
  6. print("Geschwindigkeit [1-5]")
  7. gesch = tonumber(read())
  8.  
  9. geschTab = {0.5, 0.4, 0.3, 0.2, 0.1}
  10. farbTab = {1, 256, 8, 8192, 16384, 16, 1024}
  11.  
  12.  
  13. print("Welche Hintergrundfarbe? [entsprechende Taste]")
  14. print("[1] Grau")
  15. print("[2] Blau")
  16. print("[3] Grün")
  17. print("[4] Rot")
  18. print("[5] Gelb")
  19. print("[6] Lila")
  20. event, key = os.pullEvent("key")
  21.  
  22. print("Durchlaufend: [x]")
  23. print("Abprallend: [x]")
  24. event, side, x, y = os.pullEvent("mouse_click")
  25. print(x,y)
  26. if event and x == 25 and y == 16 then
  27. p = 1
  28. elseif event and x==25 and y==17 then
  29. p = 2
  30. end
  31.  
  32. mon = peripheral.wrap("right")
  33. pos = 2 * anzahlMon
  34.  
  35. mon.clear()
  36. mon.setBackgroundColor(farbTab[key])
  37. mon.setTextColor(colors.white)
  38. mon.setTextScale(5)
  39.  
  40. while true do
  41. mon.clear()
  42. mon.setCursorPos(pos, 1)
  43. mon.write(text)
  44. pos = pos - 1
  45. os.sleep(geschTab[gesch])
  46. if pos == 1 and p ==2 then
  47. repeat
  48. pos = pos + 1
  49. mon.clear()
  50. mon.setCursorPos(pos, 1)
  51. mon.write(text)
  52. until pos == 2 * anzahlMon
  53. elseif(pos == -#text and p ==1) then
  54. pos = 2 * anzahlMon
  55. end
  56. if(redstone.getInput("front")) then -- hier Seite redstone
  57. mon.clear()
  58. mon.setBackgroundColor(colors.black)
  59. mon.setTextScale(1)
  60. os.shutdown()
  61. end
  62. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement