Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term = require("term")
- shell = require("shell")
- internet = require("internet")
- keyboard = require("keyboard")
- event = require("event")
- os = require("os")
- jenisis = {}
- function jenisis.drawScreen(staticScreen, tableScreen)
- running = true
- rkeyp = true
- cselected = 1
- num = 1
- static = true
- while running == true do
- term.clear()
- term.setCursor(1, 1)
- rkeyp = true
- isPrint = true
- num = 1
- static = true
- staticNum = 1
- param = "nulll"
- while static == true do
- line = staticScreen[staticNum]
- if line ~= nil then
- print(line)
- staticNum = staticNum + 1
- else
- static = false
- end
- end
- num = 1
- print(" ")
- while isPrint == true do
- line = tableScreen[num]
- if line ~= nil and num ~= cselected then
- print(line)
- num = num + 1
- elseif line ~= nil and num == cselected then
- print("["..line.."]")
- num = num + 1
- else
- isPrint = false
- end
- end
- while rkeyp == true do
- ev, p1, p2, key = event.pull(5, "key_down")
- if key == 200 then
- cselected = cselected - 1
- if cselected <= 0 then
- cselected = num - 1
- end
- rkeyp = false
- elseif key == 208 then
- cselected = cselected + 1
- if cselected >= num then
- cselected = 1
- end
- rkeyp = false
- elseif key == 28 then
- return cselected
- elseif key == 15 then
- return 999
- end
- end
- end
- end
- return jenisis
Add Comment
Please, Sign In to add comment