Advertisement
funnybunnyofdoom

driver

May 28th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. --API to detect the drivers
  2.  
  3.  
  4. --Get and assign the Disk side
  5. function getDiskSide()
  6. local side = nil
  7. for k,d in pairs(rs.getSides()) do
  8. if peripheral.getType(d)=='drive' then
  9. side = d
  10. drive = side
  11. break
  12. end
  13. end
  14. return drive
  15. end
  16.  
  17. --get and assign monitor side and size
  18. function getMonitorSide()
  19. local side = nil
  20. for k,v in pairs(rs.getSides()) do
  21. if peripheral.getType(v)=='monitor' then
  22. side = v
  23. monitor = side
  24. break
  25. end
  26. end
  27. if monitor == nil then
  28. monitor = "NONE"
  29. end
  30. return monitor
  31. end
  32.  
  33. function getMonitorX()
  34. x = 0
  35. y = 0
  36. if MONITOR ~= nil then
  37. MONITOR = peripheral.wrap(monitor)
  38. x,y = MONITOR.getSize()
  39. end
  40. return x
  41. end
  42.  
  43. function getMonitorY()
  44. x = 0
  45. y = 0
  46. if MONITOR ~= nil then
  47. MONITOR = peripheral.wrap(monitor)
  48. x,y = MONITOR.getSize()
  49. end
  50. return y
  51. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement