Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component") local event = require("event")
- local gpu = component.gpu
- function clear()
- W, H = gpu.getResolution() gpu.fill(1,1,W,H," ") end
- while true do
- clear()
- gpu.set(1,1,"Проверить счет")
- gpu.set(1,3,"Выйти")
- tevent = {event.pull("touch")}
- if io.open(tevent[6], "r") == nil then
- filew = io.open(tevent[6], "w") filew:write("0") filew:close() end
- if tevent[4] == 1 then
- local filer = io.open(tevent[6], "r")
- money = filer:read() filer:close()
- local filew = io.open(tevent[6], "w")
- filew:write(money) filew:close()
- clear()
- balance = "на вашем счету "..money.."$"
- gpu.set(1,1, balance)
- os.sleep(5)
- clear()
- end
- if tevent[4] == 3 then break end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement