Add files via upload

This commit is contained in:
minecartchris
2024-06-25 17:26:07 -05:00
committed by GitHub
parent 3bc18a9fc6
commit d4b94402ed
3 changed files with 55 additions and 0 deletions

26
Print.lua.lua Normal file
View File

@@ -0,0 +1,26 @@
--Very Basic Print API
local printer = peripheral.find("printer")
print("Basic PhileOS Print API")
print("V 1.0")
print("")
print("Save file to \"/print this\" to print.")
while true do
if fs.exists("print this") then
local fh = fs.open("print this", "r")
printer.newPage()
local x, y = printer.getPageSize()
local line = fh.readLine()
local linenum = 1
while line ~= nil and linenum <= y do
printer.setCursorPos(1, linenum)
printer.write(line)
linenum = linenum + 1
line = fh.readLine()
end
printer.endPage()
fh.close()
fs.delete("print this")
end
os.sleep()
end