Muzze77

AutoMiningTurtleTerminal

May 8th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. shell.run("clear")
  2. sides = {"top","left","right","front","top","back"}
  3.  
  4. for k = 1, #sides do
  5.   if peripheral.isPresent(sides[k]) then
  6.       side = sides[k]
  7.   end
  8.  
  9. end
  10.  
  11.  
  12. if side == nil then
  13.   error("Bitte Modem anschliessen",5)
  14. end
  15.  
  16.  
  17. rednet.open(side)
  18. print("Zum stoppen [S] druecken")
  19. while true do
  20.    evt, key = os.pullEvent("char")
  21.    if key == "s" or key == "S" then
  22.       rednet.broadcast("stop")
  23.       shell.run("clear")
  24.       print("Zum stoppen [S] druecken")
  25.       print("Alle Turtles angehalten")
  26.       sleep(2)
  27.       term.clearLine(2)
  28.    end  
  29.  
  30. end
Add Comment
Please, Sign In to add comment