kebbanalex

Basic Modem Search

May 24th, 2014
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. function getModem()
  2.     if peripheral.getType("bottom") == "modem" then
  3.         return "bottom"
  4.     end
  5.  
  6.     if peripheral.getType("top") == "modem" then
  7.         return "top"
  8.     end
  9.  
  10.     if peripheral.getType("back") == "modem" then
  11.         return "back"
  12.     end
  13.  
  14.     if peripheral.getType("front") == "modem" then
  15.         return "front"
  16.     end
  17.  
  18.     if peripheral.getType("left") == "modem" then
  19.         return "left"
  20.     end
  21.  
  22.     if peripheral.getType("right") == "modem" then
  23.         return "right"
  24.     end
  25.     return nil
  26. end
Add Comment
Please, Sign In to add comment