Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local com =require("component")
- local mval = 1
- local val = 1
- local adr = {}
- local lvl = {}
- local t = {}
- local uptimem = 0
- local uptimes = 0
- local gpu =com.gpu
- local x, y =gpu.maxResolution()
- local i = 0
- local event =require("event")
- local oldenergy = {}
- local term =require("term")
- local math =require("math")
- local buffer
- local btn
- for k,v in com.list("tier") do
- table.insert(adr, k)
- table.insert(lvl, v)
- mval =mval+1
- end
- tlvl = {}
- term.clear()
- function onTimer()
- uptimes =uptimes+1
- if uptimes == 60 then
- uptimem =uptimem+1
- uptimes =0
- end
- term.setCursor(1,1)
- gpu.setBackground(0x0000FF)
- gpu.setForeground(0xFFFFFF)
- gpu.fill(1, 1, x, 1, " ")
- print("системы безопасности MJ12. аптайм: " .. uptimem .. " минут и " .. uptimes .. " секунд")
- gpu.setBackground(0xffd7a3)
- gpu.setForeground(0x000000)
- end
- function flags(b)
- local text = ""
- if (t[b].isAttacksMobs()) then
- text = "атакует мобов: да "
- else text = "атакует мобов: нет "
- end
- if (t[b].isAttacksNeutrals()) then
- text =text .. "атакует неутральные цели: да "
- else text =text .. "атакует неутральные цели: нет "
- end
- if (t[b].isAttacksPlayers()) then
- text =text .. "атакует игроков: да"
- else text =text .. "атакует игроков: нет"
- end
- return text
- end
- event.timer(1, onTimer, math.huge)
- gpu.setBackground(0x0000FF)
- print("системы безопасности MJ12. аптайм: " .. uptimem .. " минут и " .. uptimes .. " секунд")
- gpu.setBackground(0xffd7a3)
- function dspl(a)
- print("--------------------------------------------------------------------------------")
- print("турель " .. a)
- print("адрес: " .. adr[a])
- print("Макс. энергии: " .. t[a].getMaxEnergyStorage() .. "RF")
- print("Текущее к-во энергии: " .. t[a].getCurrentEnergyStorage() .. "RF(" .. t[a].getCurrentEnergyStorage()/((t[a].getMaxEnergyStorage())/100) .. "%)")
- print (flags(a))
- gpu.setBackground(0xffd7a3)
- print("--------------------------------------------------------------------------------")
- end
- function idk()
- dspl(val)
- val =val+1
- end
- while val < mval do
- t[val] = com.proxy(adr[val])
- val = val+1
- end
- val = 1
- gpu.setForeground(0x000000)
- gpu.fill(1, 2, x, y-1, " ")
- while val ~= mval do
- idk()
- end
- term.setCursor((x/2-13), y-2)
- gpu.setBackground(0x0000FF)
- gpu.setForeground(0xFFFFFF)
- print("страница 1 из 1")
- print("О программе(a) Помощь(F1) Настройки целей(s) Список доверенных игроков(p)")
- term.setCursor(2, 1)
- gpu.setBackground(0xffd7a3)
- gpu.setForeground(0x000000)
- while true do
- while val ~= mval do
- idk()
- end
- val = 1
- _, _, btn, _, _ = event.pull(1, "key_down")
- while val ~=mval do
- if (val == 1) then
- term.setCursor(1, 6*val)
- else term.setCursor(1,6+7*(val-1))
- end
- if t[val].getCurrentEnergyStorage()/((t[val].getMaxEnergyStorage())/100) > 10 then
- --_, buffer =term.getCursor()
- gpu.setBackground(0xFFFF00)
- --gpu.fill(1, buffer, x, 1, " ")
- else gpu.setBackground(0xFF0000) end
- if t[val].getCurrentEnergyStorage()/((t[val].getMaxEnergyStorage())/100) > 30 then
- gpu.setBackground(0x00FF00)
- end
- _, buffer =term.getCursor()
- gpu.fill(1, buffer, x, 1, " ")
- print("Текущее к-во энергии: " .. t[val].getCurrentEnergyStorage() .. "RF(" .. t[val].getCurrentEnergyStorage()/((t
- [val].getMaxEnergyStorage())/100) .. "%)" .. mval)
- gpu.setBackground(0xffd7a3)
- val =val+1
- end
- end
Add Comment
Please, Sign In to add comment