GopherAtl, on 31 July 2013 - 01:24 AM, said:
Ehrum. Dunno how to break this to you, but... peripheral.wrap works fine with remote peripheral names.
Wat, since when? I couldn't get it to work. :|
/wastedthread
There have been 7 items by Qix (Search limited from 10-February 22)
Posted by
Qix
on 30 July 2013 - 06:06 AM
in
Ask a Pro
jesusthekiller, on 30 July 2013 - 05:52 AM, said:
Posted by
Qix
on 30 July 2013 - 05:39 AM
in
Ask a Pro
theoriginalbit, on 30 July 2013 - 05:24 AM, said:
Posted by
Qix
on 30 July 2013 - 05:35 AM
in
Tutorials
-- Wrap modem
-- Make sure to change the side
local md = peripheral.wrap("back")
assert(md)
-- Networked Peripheral Wrapper system
local net_mt = {}
local net_mtf = {}
function net_mtf:__call(...)
md.callRemote(self.pname, self.name, ...)
end
function net_mt:__index(k)
local func = {}
func.name = k
func.pname = self.name
setmetatable(func, net_mtf)
return func
end
md.wrapRemote = function(name)
assert(net_mt)
local wrapped = {}
wrapped.name = name
setmetatable(wrapped, net_mt)
return wrapped
end
-- USAGE: md.wrapRemote("perhipheral_N")
Posted by
Qix
on 30 July 2013 - 05:29 AM
in
Ask a Pro
turtle._up = turtle.up turtle.up = function(amt) for i=1,amt do turtle._up() end end
Posted by
Qix
on 30 July 2013 - 05:22 AM
in
Ask a Pro
Posted by
Qix
on 30 July 2013 - 05:18 AM
in
Ask a Pro
