Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Var = 0
- local bRunning = true
- function setC(x,y)
- term.setCursorPos(x,y)
- end
- function clr()
- term.clear()
- setC(1,1)
- end
- function checkKeys()
- event, key = os.pullEvent("key")
- if event == "key" then
- if key == keys.enter then
- clr()
- bRunning = false
- return
- elseif key == keys.up then
- clr()
- print(Var)
- Var = Var + 1
- elseif key == keys.down then
- clr()
- print(Var)
- Var = Var - 1
- end
- end
- end
- clr()
- while bRunning do
- sleep(0)
- checkKeys()
- if Var <= 6 then
- term.setCursorPos(1,2)
- print("GreaterThan")
- elseif Var >= 5 then
- term.setCursorPos(1,2)
- print("LessThan ")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement