Advertisement
Guest User

startup

a guest
Mar 1st, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. sides = {"right", "left", "bottom", "top", "front", "back"}
  2.  
  3. function start()
  4.     for k, side in pairs(sides) do
  5.         if peripheral.isPresent(side) then
  6.             if peripheral.getType(side) == "modem" then
  7.                 rednet.open(side)
  8.             end
  9.         end
  10.     end
  11.    
  12.     local x, y, z = commands.getBlockPosition()
  13.    
  14.     local command = string.format("gps host %d %d %d", x, y, z)
  15.     shell.run(command)
  16.    
  17. end
  18.  
  19. start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement