Advertisement
SirSheepe

kek

May 18th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.49 KB | None | 0 0
  1.  
  2. function peripheral.wrap(direction)
  3.     if not peripheral.isPresent(direction) then return end
  4.     local self = setmetatable({}, {__index = peripheral})
  5.  
  6.     for _, method in pairs(peripheral.getMethods(direction)) do
  7.         self[method] = function(...)
  8.             return peripheral.call(direction, method, ...)
  9.         end
  10.     end
  11.  
  12.     return self
  13. end
  14.  
  15. local monitor = peripheral.wrap("right")
  16. local sx, sy = monitor.getSize()
  17.  
  18. monitor.setPaletteColor(1, 114/255, 137/255, 218/255)
  19. monitor.drawFilledBox(1, 1, sx, sy, 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement