Advertisement
chopstyix

loadNFT

Jan 26th, 2022
1,011
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local args = {...}
  2. local paste_id = args[1]
  3. shell.run("delete image.nfp") --delete file if it already exists
  4. shell.run("pastebin", "get", paste_id, "image.nfp") --fetch NFP image from pastebin at given paste_id
  5. print("Drawing...")
  6. local old_term = term.current()
  7. local mon = peripheral.find("monitor") --find and attach to monitor
  8. mon.setTextScale(0.5)
  9. term.redirect(mon)
  10. term.clear()
  11. --draw image through paintutils
  12. local image = paintutils.loadImage("image.nfp")
  13. paintutils.drawImage(image, 0, 0)
  14. term.redirect(old_term)
  15. print("Done")
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement