Sparkybearbomb

Find Function list

Sep 12th, 2016
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local peripheralSide = "left"
  2. local file = fs.open("Function List.txt", "w")
  3. function monitorSearch()
  4. local names = peripheral.getNames()
  5. local i, name
  6. for i, name in pairs(names) do
  7. if peripheral.getType(name) == "monitor" then
  8. test = name
  9. return peripheral.wrap(name)
  10. else
  11. --return nil
  12. end
  13. end
  14. end
  15. local mon = monitorSearch()
  16. local test = peripheral.isPresent(peripheralSide)
  17. local x = 1
  18. local y = 1
  19. mon.write(test)
  20. mon.clear()
  21. mon.setCursorPos(x,y)
  22. for i,v in ipairs(peripheral.getMethods(peripheralSide))
  23. do mon.write(i..". "..v)
  24. file.writeLine(i..". "..v.."()")
  25. y = y + 1
  26. mon.setCursorPos(x,y)
  27. end
  28. y = y + 1
  29. mon.write(peripheral.getType(peripheralSide))
  30. file.close()
Add Comment
Please, Sign In to add comment