Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- UP = 200, DOWN = 208, INVIO = 28, CANC = 211
- sbin1 = colors.green
- sbin2 = colors.purple
- scdb1 = colors.yellow
- scdb2 = colors.orange
- cbin1 = colors.red
- cbin2 = colors.blue
- ccdb1 = colors.white
- ccdb2 = colors.black
- select = 0
- max = 6
- local printp = true
- stmod = {cbin1, cbin2, ccdb1, ccdb2}
- rs.setBundledOutput("bottom", 0)
- while true do
- term.clear()
- term.setCursorPos(1, 1)
- print(" Klow RAR Manager")
- print("\n")
- if rs.testBundledInput("bottom", sbin1) == true then
- print(" [ ] Banchina 1 >> ATTIVO")
- else
- print(" [ ] Banchina 1 >> DISATTIVO")
- end
- if rs.testBundledInput("bottom", sbin2) == true then
- print(" [ ] Banchina 2 >> ATTIVO")
- else
- print(" [ ] Banchina 2 >> DISATTIVO")
- end
- if rs.testBundledInput("bottom", scdb1) == true then
- print(" [ ] CdB 1 >> ATTIVO")
- else
- print(" [ ] CdB 1 >> DISATTIVO")
- end
- if rs.testBundledInput("bottom", scdb2) == true then
- print(" [ ] CdB 2 >> ATTIVO")
- else
- print(" [ ] CdB 2 >> DISATTIVO")
- end
- print("")
- print(" [ ] RICARICA")
- if printp == true and select > 0 and select ~= 5 then
- term.setCursorPos(3, select+3)
- term.write("X")
- end
- local ev, char = os.pullEvent("key")
- printp = true
- if char == 200 then
- select = select-1
- if select > max then
- select = max
- end
- elseif char == 208 then
- select = select+1
- if select < 0 then
- select = 0
- end
- elseif char == 28 then
- printp = false
- if select > 0 and select <= 4 then
- term.setCursorPos(1, 10)
- print("\n")
- print("\nSei sicuro di voler modificare il valore?\nPer confermare, premi nuovamente invio, altrimenti canc")
- local ev, char2 = os.pullEvent("key")
- if char2 == 28 then
- rs.setBundledOutput("bottom", stmod[select])
- sleep(0.2)
- rs.setBundledOutput("bottom", 0)
- print("\nValore modificato con successo!")
- sleep(1.2)
- end
- elseif select == 6 then
- term.clear()
- sleep(0.25)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment