-- Inicjalizacja danych (tylko raz przy starcie)
if not storage.expV5 then
storage.expV5 = {
sExp = exp(),
sTime = os.time()
}
end
-- Tworzymy Label w menu bota (półprzezroczyste tło, ładny tekst)
UI.Separator()
local expLabel = UI.Label("Exp/h: Czekam...")
expLabel:setColor("#00FF00") -- Zielony kolor
macro(1000, "Licznik Exp V5", function()
local currentExp = exp()
local level = level()
if not currentExp or currentExp <= 0 then return end
local timeDiff = os.time() - storage.expV5.sTime
local expGained = currentExp - storage.expV5.sExp
-- Obliczanie Exp/h
local expPerHour = 0
if timeDiff > 2 then
expPerHour = math.floor((expGained / timeDiff) * 3600)
end
-- Wzór na exp do następnego poziomu
local expForNextLevel = math.floor((50 / 3) * (level^3 - 6 * level^2 + 17 * level - 12))
local expLeft = math.max(0, expForNextLevel - currentExp)
local ttl = "N/A"
if expPerHour > 0 and expLeft > 0 then
local hours = expLeft / expPerHour
local mins = math.floor((hours % 1) * 60)
ttl = math.floor(hours) .. "h " .. mins .. "m"
end
-- Funkcja formatująca (np. 1.2kk)
local function fmt(v)
if v >= 1000000 then return string.format("%.2f", v / 1000000) .. "kk" end
if v >= 1000 then return string.format("%.1f", v / 1000) .. "k" end
return tostring(v)
end
-- Aktualizacja tekstu w panelu bota zamiast CTRL+T
expLabel:setText("Exp/h: " .. fmt(expPerHour) .. " | TTL: " .. ttl)
end)
UI.Button("Resetuj Statystyki", function()
storage.expV5.sExp = exp()
storage.expV5.sTime = os.time()
expLabel:setText("Exp/h: Zresetowano!")
end)
UI.Separator()