Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- xerox.lua A simple program for copying OpenPrinter Printed Pages
- Version 0.25
- TODO:
- Add scan to file via my custom lib
- Probably fix the amount counting
- ]]
- local component = require("component")
- local kodos = require("kodos")
- local shell = require("shell")
- local printer = component.openprinter
- printer.clear()
- local args, options = shell.parse(...)
- local amt = tonumber(args[1])
- if amt > 9 then
- error("cannot print more than 9 items")
- elseif amt < 1 then
- error("invalid count")
- end
- local lines = printer.scan()
- for cnt = 1,(amt or 1) do
- for x = 0,#lines do
- printer.writeln(lines[x])
- end
- printer.print()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement