Grauly

Untitled

Jan 29th, 2020
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 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].setAttacksPlayers(attack)
  24.     end
  25. end
  26.  
  27. function turretAttackMobs(attack)
  28.     for i=1, #turrets do
  29.         turrets[i].setTargetsMobs(attack)
  30.     end
  31. end
  32.  
  33. function turretAttackNeutrals(attack)
  34.     for i=1, #turrets do
  35.         turrets[i].setTargetsNeutrals(attack)
  36.     end
  37. end
  38.  
  39. local counter = 0
  40. while true do
  41.     turretAttackPlayers(true)
  42.     clearMonitor()
  43.     mon.write(counter)
  44.     sleep(1)
  45. end
Advertisement
Add Comment
Please, Sign In to add comment