Advertisement
Grauly

Untitled

Jan 29th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. local mon = peripheral.wrap("bottom")
  2.  
  3. local turrets = {
  4.     peripheral.wrap("OMTBase_0");
  5.     peripheral.wrap("OMTBase_1");
  6.     peripheral.wrap("OMTBase_2");
  7.     peripheral.wrap("OMTBase_3");
  8. }
  9.  
  10. function clearMonitor()
  11.     mon.setTextColor(colors.white)
  12.     mon.clear()
  13.     mon.setCursorPos(1,1)
  14. end
  15.  
  16. function nextLine()
  17.     x,y = mon.getCursorPos()
  18.     mon.setCursorPos(1,y+1)
  19. end
  20.  
  21. function turretAttackPlayers(attack)
  22.     for i=1, #turrets do
  23.         turrets[i].setTargetPlayers(attack)
  24.     end
  25. end
  26.  
  27. function turretAttackMobs(attack)
  28.     for i=1, #turrets do
  29.         turrets[i].setTargetMobs(attack)
  30.     end
  31. end
  32.  
  33. local counter = 0
  34. while true do
  35.     turretAttackPlayers(true)
  36.     clearMonitor()
  37.     mon.write(counter)
  38.     sleep(1)
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement