Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Load the image file
- local imageFile = fs.open("image.nfp", "r")
- local imageContents = imageFile.readAll()
- imageFile.close()
- -- Open a new monitor
- local monitor = peripheral.wrap("top")
- monitor.setTextScale(0.5) -- Adjust text scale if necessary
- -- Clear the monitor
- monitor.clear()
- -- Decode and draw the image on the monitor
- local x, y = 1, 1
- for byte in imageContents:gmatch(".") do
- monitor.setPixel(x, y, tonumber(byte, 16))
- x = x + 1
- if x > monitor.getSize() then
- x = 1
- y = y + 1
- end
- end
- -- Wait for user input (optional)
- print("Press any key to exit")
- os.pullEvent("key")
- xit")
- os.pullEvent("key")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement