Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

show_methods

By: VaMinion on Nov 28th, 2013  |  syntax: Lua  |  size: 0.58 KB  |  hits: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -- Shows the methods associated with a peripheral that's placed at the back of the computer.
  2. myTank = peripheral.wrap("back")
  3. tankArray = myTank.getTankInfo("back")
  4. tankArray2 = myTank.getAdvancedMethodsData()
  5. spacing = " "
  6. --print(tankArray)
  7. print(myTank.listMethods())
  8. print(myTank.getTankInfo("back"))
  9. print("")
  10. print(tankArray)
  11. print("")
  12.  
  13. function printTable(t)
  14.  for k,v in pairs(t) do
  15.     print("k: "..tostring(k).." v:", v)
  16.     if (type(v) == "table") then
  17.      printTable(v, " ".."\t")
  18.     end
  19.  end
  20. end
  21.      
  22. printTable(tankArray)
  23. print("")
  24. --printTable(tankArray2)