Advertisement
OldDragon2A

show image

Feb 12th, 2013
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. local function showImage(monitor, file)
  2.   local mon = peripheral.wrap(monitor)
  3.   term.redirect(mon)
  4.   local image = paintutils.loadImage(file)
  5.   paintutils.drawImage(image, 1, 1)
  6.   term.redirect(term.native)
  7. end
  8.  
  9. local args = {...}
  10. if #args == 2 then
  11.   if fs.exists(args[2]) then
  12.     showImage(args[1], args[2])
  13.   else
  14.     print("Image Not Found")
  15.   end
  16. else
  17.   print("Usage: showimage <monitor> <image>")
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement