Advertisement
koki2000

device finder

Oct 6th, 2015
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.50 KB | None | 0 0
  1. for _,b in pairs (rs.getSides()) do
  2.   if peripheral.getType(b) == "modem" then
  3.   print("modemet talaltam a ", b, " oldalon")
  4.   rednet.open(b)
  5.   end
  6.   if peripheral.getType(b) == "monitor" then
  7.   print("monitort talaltam a ", b, " oldalon")
  8.   m = peripheral.wrap(b)
  9.   end
  10.   if peripheral.getType(b) == "drive" then
  11.   print("meghajtot talaltam a ", b, " oldalon")
  12.   end
  13.   if peripheral.getType(b) == "printer" then
  14.   print("nyomtatot talaltam a ", b, " oldalon")
  15.   end
  16. end
  17. sleep(2)
  18. rednet.close(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement