Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ TileCodes ]]--
- --[[ Created by Just Does Games ]]--
- --[[ Version 1.0 ]]--
- --[[ VARIABLES ]]--
- local selected = 0
- --[[ VARIABLES ]]--
- --[[ FUNCTION ]]--
- function clr() term.clear() end
- function cp(x,y) term.setCursorPos(x,y) end
- --function sb(col) term.setBackgroundColor(colors[col]) end
- function st(col) term.setTextColor(colors[col]) end
- function update()
- clr() cp(1,1)
- print(selected)
- if selected == 0 then
- st("gray")
- else
- st("white")
- end
- print("-") st("white")
- print("")
- print(string.char(selected))
- print("")
- if selected == 255 then
- st("gray")
- else
- st("white")
- end
- print("+") st("white")
- end
- --[[ FUNCTION ]]--
- --[[ MAIN ]]--
- function main()
- local running = true
- while running do
- update()
- a,i = os.pullEvent("key")
- if i == keys.w or i == keys.up then
- if selected ~= 0 then
- selected = selected - 1
- end
- elseif i == keys.s or i == keys.down then
- if selected ~= 255 then
- selected = selected + 1
- end
- elseif i == keys.q or i == keys.enter then
- running = false
- end
- end
- end
- main()
- print("Final Number: "..selected)
- print("Display: "..string.char(selected))
- print("Code: string.char("..selected..")")
- --[[ MAIN ]]--
Advertisement
Add Comment
Please, Sign In to add comment