Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function exit()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- end
- term.setBackgroundColor(colors.white)
- term.setTextColor(colors.blue)
- term.clear()
- term.setCursorPos(18, 1)
- term.setBackgroundColor(colors.lightBlue)
- term.setCursorPos(1, 1)
- write('X')
- term.setBackgroundColor(colors.white)
- term.setCursorPos(18, 1)
- write('TDE VIWER 1.0')
- term.setCursorPos(4, 5)
- stri = 5
- i = 1
- while i <= 100 do
- if fs.exists('/photos/photo'..i) then
- if i % 5 == 0 then
- term.setCursorPos(4, stri + 2)
- stri = stri + 2
- write('photo'..i..' ')
- else
- write('photo'..i..' ')
- end
- end
- i = i + 1
- end
- term.setCursorPos(3, stri + 2)
- write('number of photo>')
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if event == 'mouse_click' then
- if (Y == stri + 2) then
- photo = read()
- if (photo == '') or (photo == 'exit') or (tonumber(photo) > 100) then
- exit()
- break
- end
- if fs.exists('/photos/photo'..photo) then
- image = paintutils.loadImage('/photos/photo'..photo)
- file = fs.open('/photos/photo'..photo, 'r')
- a = file.readLine()
- file.close()
- a = string.len(a)
- if a < 56 then
- paintutils.drawImage(image, 2, 3)
- else
- paintutils.drawImage(image, 1, 3)
- end
- x, y = term.getCursorPos()
- term.setCursorPos(1, y + 1)
- term.setBackgroundColor(colors.white)
- write('photo loaded!')
- while true do
- local event, button, X, Y = os.pullEventRaw()
- if event == 'mouse_click' then
- if X == 1 and Y == 1 then
- break
- end
- end
- end
- end
- exit()
- break
- elseif X == 1 and Y == 1 then
- exit()
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement