Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function scrollDown(plc, mx, num)
- plc[num] = 0
- if num < mx then
- num = num + 1
- end
- plc[num] = 1
- return num
- end
- function scrollUp(plc, mx, num)
- plc[num] = 0
- if num > 1 then
- num = num - 1
- end
- plc[num] = 1
- return num
- end
- function draw(plc, mx, lst)
- term.clear()
- term.setCursorPos(1, 1)
- term.write("=====================OSX=========================")
- --Insert all other draws here
- i = 1
- while i <= mx do
- term.setCursorPos(2, (i + 3))
- term.write(lst[i])
- if plc[i] == 1 then
- term.write(" <<<")
- end
- i = i + 1
- end
- end
- a = {1, 0, 0, 0}
- list = {"Programs", "Fari", "About", "Quit"}
- max = 4
- arrow = 1
- while true do
- draw(a, max, list)
- e, r = os.pullEvent()
- if r == "w" then
- arrow = scrollUp(a, max, arrow)
- end
- if r == "s" then
- arrow = scrollDown(a, max, arrow)
- end
- if r == 28 then
- end
- end
Add Comment
Please, Sign In to add comment