Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- 009Zm3kF
- local Terminal = require("/terminal").new()
- local TEXT = {
- "0 - &0White",
- "1 - &1Orange",
- "2 - &2Magenta",
- "3 - &3Li.Blue",
- "4 - &4Yellow",
- "5 - &5Lime",
- "6 - &6Pink",
- "7 - &7Grey",
- "8 - &8Li.Gray",
- "9 - &8Cyan",
- "a - &aPurple",
- "b - &bBlue",
- "c - &cBrown",
- "d - &dGreen",
- "e - &eRed",
- "f - &7Black",
- }
- function main()
- Terminal:reset()
- yStart = 4
- local yPos = yStart
- repeat
- -- generate the list at yPos, which is incremented and decremented to choose the starting pos of list, header and info is written above that
- Terminal:reset()
- Terminal:displayFromList(yPos,TEXT)
- Terminal:display(0,
- "&c"..Terminal:makeSeperator("="),
- " &dColors ~",
- "&c"..Terminal:makeSeperator("="),
- ""
- )
- Terminal:writeLine(Terminal.size.y,"&1[ArrowKeys] - scroll. [Backspace] - exit.")
- Terminal:writeLine(Terminal.size.y-1,"yPos: "..tostring(yPos))
- local key = Terminal:waitForKey()
- if key == 265 then -- up
- yPos = yPos + 1
- if yPos > yStart then
- yPos = yStart
- end
- elseif key == 264 then -- down
- yPos = yPos - 1
- if yPos < yStart-#TEXT+8 then
- yPos = yStart-#TEXT+8
- end
- end
- until key == 259 -- backspace
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement