-
-
Save SirEndii/954e9888fac01efe8f23e82d0ae06e92 to your computer and use it in GitHub Desktop.
AR Controller programm.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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