Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.black)
- local camera = peripheral.wrap('back')
- local array = "387f70f7"
- term.clear()
- local yp = 1
- saved = false
- info = ''
- local ya = 1
- for j = -0.35,0.25,0.025 do
- for i = -1,1,0.036 do
- local d = camera.distance(i, 0-j)
- local a = 1
- if d > 0 then a = 2 + (8 - math.min(8, (d/1.2))) end
- if yp == 1 then
- ya = 1
- end
- if yp ~= ya then
- info = info..'\n'..string.sub(array, a, a)
- ya = yp
- else
- info = info..string.sub(array, a, a)
- end
- end
- yp = yp + 1
- term.setCursorPos(1, yp)
- if yp == 17 then
- file = fs.open('.tde-photo-cache', 'w')
- file.write(info)
- file.close()
- picture = paintutils.loadImage('.tde-photo-cache')
- paintutils.drawImage(picture, 1, 1)
- break
- end
- end
- term.setCursorPos(1, 18)
- term.setTextColor(colors.yellow)
- write('[Save]')
- write(' [Exit]')
- term.setTextColor(colors.blue)
- write(' TDE photos')
- while true do
- local event, button, x, y = os.pullEventRaw()
- if (event == 'mouse_click') and (x >= 1) and (x <= 6) and y == 18 then
- for i = 1, 100 do
- if not fs.exists('photos') then
- shell.run('mkdir /photos')
- end
- if (not fs.exists('photos/photo'..i)) and (saved == false) then
- file = fs.open('photos/photo'..i, 'w')
- file.writeLine(info)
- file.close()
- term.setCursorPos(1, 19)
- write('saved!')
- saved = true
- break
- end
- end
- elseif (event == 'mouse_click') and (x >= 7) and (x <= 7 + 6) and (y == 18) then
- term.clear()
- term.setCursorPos(1, 1)
- if fs.exists('.tde-photo-cache') then
- shell.run('rm /.tde-photo-cache')
- end
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement