Hi!

So I was messing around in notepad++ with lua yesterday, and I just got the Idea to improve my way for showing OpenPeripherals methods. So, I came up with a program that automatically finds the needed info.
How to use:

1. Get the code to your computer using

pastebin get 7STZp04e (name of your choise)

2. Place a monitor on one sidet (the monitor should be at least 3 monitors wide, and quite tall to have it show all methods, or you could decrease monitor text scale)

3. Place the block you want to show the methods for on another side

4. Run the program


Pastebin:

http://pastebin.com/7STZp04e


Code:

pTop=peripheral.isPresent("top")
pBottom=peripheral.isPresent("bottom")
pBack=peripheral.isPresent("back")
pFront=peripheral.isPresent("front")
pLeft=peripheral.isPresent("left")
pRight=peripheral.isPresent("right")

if pTop == true and peripheral.getType("top") == "monitor" then
monitor=peripheral.wrap("top")
elseif pTop==true then
pSide="top"
end
if pBottom == true and peripheral.getType("bottom") == "monitor" then
monitor=peripheral.wrap("bottom")
elseif pBottom==true then
pSide="bottom"
end
if pBack == true and peripheral.getType("back") == "monitor" then
monitor=peripheral.wrap("back")
elseif pBack==true then
pSide="back"
end
if pFront == true and peripheral.getType("front") == "monitor" then
monitor=peripheral.wrap("front")
elseif pFront==true then
pSide="front"
end
if pLeft == true and peripheral.getType("left") == "monitor" then
monitor=peripheral.wrap("left")
elseif pLeft==true then
pSide="left"
end
if pRight == true and peripheral.getType("right") == "monitor" then
monitor=peripheral.wrap("right")
elseif pRight==true then
pSide="right"
end
monitor.clear()
monitor.setCursorPos(1, 1)
for i, v in ipairs(peripheral.getMethods(pSide)) do
monitor.write(i..". "..v)
monitor.setCursorPos(1, i+1)
end

Known bugs:
  • Trying to find methods for a monitor creates an error
Please report any other bugs found in the comments!