Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- bios.lua
- -- Bunny83: Added wrap function for wired modems
- peripheral.wrap = function( _sSide )
- if peripheral.isPresent( _sSide ) then
- local tMethods = peripheral.getMethods( _sSide )
- local tResult = {}
- for n,sMethod in ipairs( tMethods ) do
- tResult[sMethod] = function( ... )
- return peripheral.call( _sSide, sMethod, ... )
- end
- end
- if peripheral.getType(_sSide) == "modem" and not tResult.isWireless() then
- tResult.wrap = function( _sName )
- if tResult.isPresentRemote( _sName ) then
- local tMethods2 = tResult.getMethodsRemote( _sName )
- local tResult2 = {}
- for n,sMethod in ipairs( tMethods2 ) do
- tResult2[sMethod] = function( ... )
- return tResult.callRemote( _sName, sMethod, ... )
- end
- end
- return tResult2
- end
- return nil
- end
- end
- return tResult
- end
- return nil
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement