Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function enable(side)
- side = side or ""
- if peripheral.isPresent(side) then
- name = peripheral.getType(side)
- if name == "magic" then
- magic = {}
- meth = peripheral.getMethods(side)
- for x = 1 , #meth do
- magic[meth[x]] = function( ... ) return peripheral.call( side , meth[x] , ... ) end
- end
- return true
- end
- end
- return false
- end
- function disable()
- magic = nil
- return true
- end
- function list()
- for n,side in pairs( redstone.getSides() ) do
- if peripheral.isPresent(side) and peripheral.getType(side) == "magic" then
- print (textutils.tabulate(peripheral.getMethods(side)))
- return
- end
- end
- print "No Magic Peripheral Found"
- end
Add Comment
Please, Sign In to add comment