Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HUD Request
#1
Hi,

is it possible to have a HUD to show how much exp is left to level? so when I level I can see I have like 1000 exp left to next level?

Also is it possible to do this in terms of monsters? so I have 1000 Exp left to level AKA 25 Rotworms

Thanks
Reply

#2
Hello.

Yes, but you would need to setup each monster and its experience.
local MONSTERS = {
    { Name = 'Rat', XP = 5 },
    { Name = 'Rotworm', XP = 40 },
}
local HUD_POS = { X = 100, Y = 100 }


if estimatedTimeLevelUpText == nil then
    function estimatedTimeLevelUpText(expLeft, expHour)
        if expHour <= 0 then
            return "Exp/h is invalid"
        end
        
        local hoursLeft = expLeft / expHour
        local hours = math.floor(hoursLeft)
        local minutes = math.floor((hoursLeft - hours) * 60)
        
        return string.format("Estimated time to level up: %d hours e %d minutes", hours, minutes)
    end
end

local experienceToLevel = exptolevel()
addtextstroke('Exp to level: ' .. tostring(experienceToLevel), HUD_POS.X, HUD_POS.Y)
HUD_POS.Y = HUD_POS.Y + 20

addtextstroke(estimateTimeLevelUpText(experienceToLevel, exphour()), HUD_POS.X, HUD_POS.Y)
HUD_POS.Y = HUD_POS.Y + 20

local count = 0
for _, monster in ipairs(MONSTERS) do
    addtext('-- ' .. tostring(math.ceil(experienceToLevel / monster.XP)) .. ': ' .. monster.Name .. 's', HUD_POS.X + 8, HUD_POS.Y + (count * 20))
    count = count + 1
end
Reply

#3
Awesome, so if I have the EXP/H and Exp to next level can I create a calculation that says EXP to next level / EXP H to show "Next Level in Approx 2 hours"?
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Smile" title="Smile" class="smilie smilie_1" />
Reply

#4
|Only Registered members can see download links. | Click here to buy subscription or here to register.

Yes
|Only Registered members can see download links. | Click here to buy subscription or here to register.

exptolevel(optional number level) [number]: Amount of experience to level.
expgained() [number]: Returns exp gained since you chosen the client.
exphour() [number]: Current exp per hour
Reply

#5
Tried to get it to work myself but cant, just need a single link of code to add to HUD that gives me time to level based on current exp an hour and remaining exp but I keep getting console errors
|Only Registered members can see download links. | Click here to buy subscription or here to register.
|Only Registered members can see download links. | Click here to buy subscription or here to register.alt="Sad" title="Sad" class="smilie smilie_8" />
Reply

#6
|Only Registered members can see download links. | Click here to buy subscription or here to register.
That's just expLeft / expHour, but i've added to code.
Please, next time make your full request at once.
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016