Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drawBackground()
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(colors.black)
- x,y = mon.getSize()
- for yc = 1,y do
- if yc%2 == 1 then
- mon.setBackgroundColor(colors.purple)
- else
- mon.setBackgroundColor(colors.magenta)
- end
- for xc = 1,x do
- mon.setCursorPos(xc, yc)
- mon.write(" ")
- end
- end
- end
- function drawButtons()
- x,y = mon.getSize()
- for i=1,y do
- if fs.exists(tostring(i)) then
- file = fs.open(tostring(i), "r")
- label = file.readAll()
- file.close()
- mon.setCursorPos(x/2 - string.len(label)/2, i)
- if i%2 == 1 then
- mon.setBackgroundColor(colors.purple)
- else
- mon.setBackgroundColor(colors.magenta)
- end
- mon.setTextColor(colors.white)
- mon.write(label)
- mon.setCursorPos(x-2, i)
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(" X ")
- end
- end
- end
- drawBackground()
- drawButtons()
- while true do
- os.pullEvent()
- rs.setOutput("back", true)
- sleep(1)
- rs.setOutput("back", false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement