Skip to content

Instantly share code, notes, and snippets.

@SirEndii

SirEndii/.lua Secret

Created April 27, 2021 11:59
Show Gist options
  • Select an option

  • Save SirEndii/954e9888fac01efe8f23e82d0ae06e92 to your computer and use it in GitHub Desktop.

Select an option

Save SirEndii/954e9888fac01efe8f23e82d0ae06e92 to your computer and use it in GitHub Desktop.
AR Controller programm.
if #arg < 1 then
error("Missing argument: File path")
end
filePath = arg[1]
if not fs.exists(filePath) then
error("File not found.")
end
file = fs.open(filePath, "r")
width = 0
height = 0
repeat
line = file.readLine()
if line ~= nil then
if #line > width then
width = #line
end
height = height + 1
end
until line == nil
controller = peripheral.find("arController")
if controller == nil then
error("Controller not found.")
end
controller.setRelativeMode(true, width, height)
os.run({}, "ar_paint.lua", filePath, 0, 0, width, height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment