FoxWorn3365

RFI - RAR HI

Jan 24th, 2025 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. -- UP = 200, DOWN = 208, INVIO = 28, CANC = 211
  2.  
  3. sbin1 = colors.green
  4. sbin2 = colors.purple
  5. scdb1 = colors.yellow
  6. scdb2 = colors.orange
  7.  
  8. cbin1 = colors.red
  9. cbin2 = colors.blue
  10. ccdb1 = colors.white
  11. ccdb2 = colors.black
  12.  
  13. select = 0
  14. max = 6
  15.  
  16. local printp = true
  17.  
  18. stmod = {cbin1, cbin2, ccdb1, ccdb2}
  19.  
  20. rs.setBundledOutput("bottom", 0)
  21.  
  22. while true do
  23. term.clear()
  24. term.setCursorPos(1, 1)
  25. print(" Klow RAR Manager")
  26. print("\n")
  27. if rs.testBundledInput("bottom", sbin1) == true then
  28. print(" [ ] Banchina 1 >> ATTIVO")
  29. else
  30. print(" [ ] Banchina 1 >> DISATTIVO")
  31. end
  32.  
  33. if rs.testBundledInput("bottom", sbin2) == true then
  34. print(" [ ] Banchina 2 >> ATTIVO")
  35. else
  36. print(" [ ] Banchina 2 >> DISATTIVO")
  37. end
  38.  
  39. if rs.testBundledInput("bottom", scdb1) == true then
  40. print(" [ ] CdB 1 >> ATTIVO")
  41. else
  42. print(" [ ] CdB 1 >> DISATTIVO")
  43. end
  44.  
  45. if rs.testBundledInput("bottom", scdb2) == true then
  46. print(" [ ] CdB 2 >> ATTIVO")
  47. else
  48. print(" [ ] CdB 2 >> DISATTIVO")
  49. end
  50.  
  51. print("")
  52.  
  53. print(" [ ] RICARICA")
  54.  
  55. if printp == true and select > 0 and select ~= 5 then
  56. term.setCursorPos(3, select+3)
  57. term.write("X")
  58. end
  59.  
  60. local ev, char = os.pullEvent("key")
  61.  
  62. printp = true
  63.  
  64. if char == 200 then
  65. select = select-1
  66. if select > max then
  67. select = max
  68. end
  69. elseif char == 208 then
  70. select = select+1
  71. if select < 0 then
  72. select = 0
  73. end
  74. elseif char == 28 then
  75. printp = false
  76. if select > 0 and select <= 4 then
  77. term.setCursorPos(1, 10)
  78. print("\n")
  79. print("\nSei sicuro di voler modificare il valore?\nPer confermare, premi nuovamente invio, altrimenti canc")
  80.  
  81. local ev, char2 = os.pullEvent("key")
  82.  
  83. if char2 == 28 then
  84. rs.setBundledOutput("bottom", stmod[select])
  85. sleep(0.2)
  86. rs.setBundledOutput("bottom", 0)
  87.  
  88. print("\nValore modificato con successo!")
  89. sleep(1.2)
  90. end
  91. elseif select == 6 then
  92. term.clear()
  93. sleep(0.25)
  94. end
  95. end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment