Grauly

Untitled

Jan 29th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 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.     mon.setTextColor(colors.white)
  20. end
  21.  
  22. function turretAttackPlayers(attack)
  23.     for i=1, #turrets do
  24.         turrets[i].setAttacksPlayers(attack)
  25.     end
  26. end
  27.  
  28. function turretAttackMobs(attack)
  29.     for i=1, #turrets do
  30.         turrets[i].setTargetsMobs(attack)
  31.     end
  32. end
  33.  
  34. function turretAttackNeutrals(attack)
  35.     for i=1, #turrets do
  36.         turrets[i].setTargetsNeutrals(attack)
  37.     end
  38. end
  39.  
  40. function printTurretInfo()
  41.     for i=1, #turrets do
  42.         mon.write("Turret: "..i..turrets[i].getType().." "..math.floor(turrets[i].getEnergyStored()/getMaxEnergyStored))
  43.     end
  44. end
  45. local counter = 0
  46. while true do
  47.     printTurretInfo()
  48.     clearMonitor()
  49.     mon.write(counter)
  50.     sleep(1)
  51. end
Advertisement
Add Comment
Please, Sign In to add comment