Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --API to detect the drivers
- --Get and assign the Disk side
- function getDiskSide()
- local side = nil
- for k,d in pairs(rs.getSides()) do
- if peripheral.getType(d)=='drive' then
- side = d
- drive = side
- break
- end
- end
- return drive
- end
- --get and assign monitor side and size
- function getMonitorSide()
- local side = nil
- for k,v in pairs(rs.getSides()) do
- if peripheral.getType(v)=='monitor' then
- side = v
- monitor = side
- break
- end
- end
- if monitor == nil then
- monitor = "NONE"
- end
- return monitor
- end
- function getMonitorX()
- x = 0
- y = 0
- if MONITOR ~= nil then
- MONITOR = peripheral.wrap(monitor)
- x,y = MONITOR.getSize()
- end
- return x
- end
- function getMonitorY()
- x = 0
- y = 0
- if MONITOR ~= nil then
- MONITOR = peripheral.wrap(monitor)
- x,y = MONITOR.getSize()
- end
- return y
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement