Advertisement
funnybunnyofdoom

detectMethod

Nov 28th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. --This program will detect the
  2. --methods of peripherals
  3. --attached to the PC
  4. --Author: FunnyBunnyofDOOM
  5.  
  6. function saveMethods(side)
  7. SIDE = side or "back"
  8. methodTable = peripheral.getMethods(SIDE)
  9. file = fs.open("/BunnyOS/documents/Methods",'a')
  10. file.write(methodTable)
  11. file.close()
  12. print("Methods saved for side "..SIDE)
  13. end
  14.  
  15. sideInput() -- Asks the user what side to scan
  16. print("What side should I scan?")
  17. local scanSide = io.read()
  18. print("scanning the "..scanSide.." side")
  19. saveMethods(scanSide)
  20. os.sleep(2)
  21. print("Methods saved to /BunnyOS/documents/Methods")
  22. os.sleep(2)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement