MastaC729

JJPeripherals Test w/ Row/Column Algorithm

Aug 27th, 2015
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --os.loadAPI("rom/jjperipherals/groups")
  2. print(os.loadAPI("potato"))
  3.  
  4. local pr = peripheral.wrap("peripheral_relay_18")
  5.  
  6. print(textutils.serialise(pr.getAttachedMethods()))
  7.  
  8. pList = peripheral.getNames()
  9. print(textutils.serialise(pList))
  10.  
  11. for i=0, 224 do   -- Keep this for row and column calculation  
  12.   rowNum = math.floor(i/15 + 1)
  13.   columnNum = i+1-15*(rowNum-1)
  14.   print(tostring(i)..": "..tostring(rowNum)..", "..tostring(columnNum))
  15. end
  16.  
  17. potato.init()
  18.  
  19. pr.setName("James the Cat")
  20.  
  21. pr = potato.wrapByName("James the Cat")
  22.  
  23. print(pr.getAttachedMethods())
Advertisement
Add Comment
Please, Sign In to add comment