Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- HouseScript by houseofkraft
- ]]--
- -- This is a entirely new programming language for ComputerCraft
- local args = { ... }
- local vars = {}
- if args[1] == "-hs" then
- if #args < 2 then
- printError("Usage: housescript -hs <file>")
- error()
- end
- local f = args[2]
- file = fs.open(f, "r")
- local lines = 0
- while file.readLine() do
- lines = lines + 1
- end
- file.close()
- file = fs.open(f, "r")
- for k = 1, #lines do
- v = file.readLine()
- if v:find("sys.print()") then
- if v == "sys.print(" then
- printError(shell.getRunningProgram()..": "..tostring(k)..": ) expected, (to close sys.print on line "..tostring(k)..")")
- error()
- elseif v == "sys.print)" then
- printError(shell.getRunningProgram()..": "..tostring(k)..": expected ()")
- error()
- end
- local s = v:gsub("sys.print(", "")
- s = s:sub(2, #s - 1)
- s = s:gsub('"', '')
- print(tostring(s))
- elseif v == "sys.shutdown()" then
- os.shutdown()
- elseif v == "io.clear()" then
- term.clear()
- elseif v == "sys.reboot()" then
- os.reboot()
- elseif v:find("**") then
- -- Comment symbol, do nothing
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement