Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
- local ____exports = {}
- local ____component = require("component")
- local gpu = ____component.gpu
- local event = require("event")
- local keyboard = require("keyboard")
- local ____term = require("term")
- local setCursor = ____term.setCursor
- local exitProgram, clear
- function exitProgram(self, condition)
- if condition then
- os.exit(0)
- end
- end
- function clear(self)
- local width, height = gpu.getResolution()
- gpu.setBackground(0)
- return gpu.fill(1, 1, width, height, " ")
- end
- local function main(self)
- clear(nil)
- setCursor(1, 1)
- while true do
- local keyboardAddress, char, code, number, playerName = event.pull("key_down")
- print(
- (((((((("kAdr: " .. keyboardAddress) .. ", char: ") .. tostring(char)) .. ", code: ") .. tostring(code)) .. ", number: ") .. tostring(number)) .. ", player: ") .. tostring(playerName)
- )
- if number == 30 then
- clear(nil)
- setCursor(1, 1)
- end
- exitProgram(
- nil,
- (number == 30) and keyboard.isControlDown()
- )
- end
- end
- main(nil)
- return ____exports
Add Comment
Please, Sign In to add comment