mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 14:43:27 +02:00
Updated vithrax bot config to version 1.2, fixed market bug and battle button bug
This commit is contained in:
@@ -282,24 +282,13 @@ function onSkillButtonClick(button)
|
||||
end
|
||||
|
||||
function onExperienceChange(localPlayer, value)
|
||||
local postFix = ""
|
||||
if value > 1e15 then
|
||||
postFix = "B"
|
||||
value = math.floor(value / 1e9)
|
||||
elseif value > 1e12 then
|
||||
postFix = "M"
|
||||
value = math.floor(value / 1e6)
|
||||
elseif value > 1e9 then
|
||||
postFix = "K"
|
||||
value = math.floor(value / 1e3)
|
||||
end
|
||||
setSkillValue('experience', comma_value(value) .. postFix)
|
||||
setSkillValue('experience', comma_value(value))
|
||||
end
|
||||
|
||||
function onLevelChange(localPlayer, value, percent)
|
||||
setSkillValue('level', value)
|
||||
local text = tr('You have %s percent to go', 100 - percent) .. '\n' ..
|
||||
tr('%s of experience left', expToAdvance(localPlayer:getLevel(), localPlayer:getExperience()))
|
||||
tr('%s of experience left', comma_value(expToAdvance(localPlayer:getLevel(), localPlayer:getExperience())))
|
||||
|
||||
if localPlayer.expSpeed ~= nil then
|
||||
local expPerHour = math.floor(localPlayer.expSpeed * 3600)
|
||||
@@ -308,7 +297,7 @@ function onLevelChange(localPlayer, value, percent)
|
||||
local hoursLeft = (nextLevelExp - localPlayer:getExperience()) / expPerHour
|
||||
local minutesLeft = math.floor((hoursLeft - math.floor(hoursLeft))*60)
|
||||
hoursLeft = math.floor(hoursLeft)
|
||||
text = text .. '\n' .. tr('%d of experience per hour', expPerHour)
|
||||
text = text .. '\n' .. comma_value(expPerHour) .. tr(' of experience per hour')
|
||||
text = text .. '\n' .. tr('Next level in %d hours and %d minutes', hoursLeft, minutesLeft)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user