Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
local function makeDocs(name, docs) if type(docs) ~= "table" then error("Invalid docs. Not a table") end local file = fs.open(("%s_docs.txt"):format(name), "w") if not file then error("Unable to create file.") end for key, value in pairs(docs) do local parts = {} for text in string.gmatch(value, "([^-]+)") do table.insert(parts, text) end local returnValue = parts[1] local description = parts[2] file.write(key) file.write(" ") file.write(returnValue) file.write("\n") file.write("->") file.writeLine(description) end file.close() end local peripherals = peripheral.getNames() for _, value in ipairs(peripherals) do local perip = peripheral.wrap(value) if not (perip["getInkLevel"] and perip["getPageSize"]) then -- Skip printing docs if peripheral is printer local docs = perip.getDocs() makeDocs(peripheral.getName(perip), docs) end end
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)