__________ __________ __________ __________ __________
Code: Select all
-- XP array by LordMortiferus 2013/01/28, rehashed by Brentoboy
-- snip snip
-- beginning of XP-array
req_xp = {}
req_xp[1] = 0 -- fixed XP value
req_xp[2] = 200 -- fixed XP value
req_xp[26] = 93000 -- fixed XP value
for i=3,25 do -- adds XP for lvl 3 to 25 to array
req_xp[i] = math.floor(req_xp[i-1]+1.2*(req_xp[i-1]-req_xp[i-2]))
end
for i=27,1000 do -- adds XP for lvl 27 to 1000 to array
req_xp[i] = req_xp[i-1]+(i-26)*1000*4+15000
end
-- snip snip
-- end of XP-array
ched_xp_init=true
ched_xp_arr={}
function ched_xp_initfunc()
if ched_xp_init then
ched_xp=me.xp
ched_xp_currentlvl=me.lvl-(me.remort_level*75)
ched_lastxp=0
ched_xp_next_level = 0
ched_xp_p_fmin = 0
ched_xp_p_tmin = 0
ched_xp_lasttickxp = me.xp
ched_xp_lastname=me.name
ched_xp_init=false
for i=1,600 do
ched_xp_arr[i]=0
end
end
end
function ched_xp_xppmin()
if ched_xp_init then
ched_xp_initfunc()
end
if ched_xp<me.xp then
ched_lastxp=me.xp-ched_xp
ched_xp=me.xp
end
if ched_lastxp == me.xp
or ched_xp_lastname ~= me.name then
ched_xp_init=true
ched_xp_initfunc()
end
if (OPS) then --Only run this once per second
ched_xp_next_level = (req_xp[(ched_xp_currentlvl+1)]-me.xp)
if ched_xp_next_level < 0 then --To account for non-meditated levels
ched_xp_currentlvl = ched_xp_currentlvl + 1
end
local xpperminuteftotal = 0
local xpperminutettotal = 0
for i=1,300 do --5 to 10 minutes back
ched_xp_arr[(600-(i-1))]=ched_xp_arr[(600-i)]
xpperminutettotal=xpperminutettotal+ched_xp_arr[(600-(i-1))]
end
for i=1,299 do --0 to 5 minutes back
ched_xp_arr[(300-(i-1))]=ched_xp_arr[(300-i)]
xpperminuteftotal=xpperminuteftotal+ched_xp_arr[(300-(i-1))]
end
ched_xp_arr[1]=me.xp-ched_xp_lasttickxp
xpperminuteftotal=xpperminuteftotal+ched_xp_arr[1]
xpperminutettotal=xpperminutettotal+xpperminuteftotal
ched_xp_p_fmin = math.floor(xpperminuteftotal/5)
ched_xp_p_tmin = math.floor(xpperminutettotal/10)
ched_xp_lasttickxp = me.xp
end
end
but on your alt+m menu, I don't see a CURRENT LEVEL part that you can add. LordMortiferus (hashed by Brentoboy) made one where it calculates your level, even when you have meditated. (below)
__________ __________ __________ __________ __________
Code: Select all
-- XP by LordMortiferus 2013/01/28, rehashed by Brentoboy
session_start_xp = me.xp -- var to calculate xp gain per session
session_start_age = me.age -- var to calculate time played per session
session_time = 0
current_level = 0
-- beginning of XP-array
req_xp = {}
req_xp[1] = 0 -- fixed XP value
req_xp[2] = 200 -- fixed XP value
req_xp[26] = 93000 -- fixed XP value
for i=3,25 do -- adds XP for lvl 3 to 25 to array
req_xp[i] = math.floor(req_xp[i-1]+1.2*(req_xp[i-1]-req_xp[i-2]))
end
for i=27,1000 do -- adds XP for lvl 27 to 1000 to array
req_xp[i] = req_xp[i-1]+(i-26)*1000*4+15000
end
if me.xp >= req_xp[1000] then
current_level = 1000
else
for i = 1,999 do -- getting current player level based on array
if req_xp[i] <= me.xp
and req_xp[i + 1] > me.xp
then
current_level = i
break
end
end
end
-- end of XP-array
function lordmort_xp_level()
if current_level <= 1000 then
local xptolvl_float = ((me.xp - req_xp[current_level]))/(req_xp[current_level+1]-req_xp[current_level]) -- % needed for next level
local lvl_float = current_level + me.remort_level * 75 + xptolvl_float -- combines actual lvl with the % needed for next lvl
-- checks if player leveled or remorted
if xptolvl_float >= 1 or xptolvl_float < 0 then
for i = 1,999 do
if req_xp[i] <= me.xp
and req_xp[i + 1] > me.xp
then
current_level = i
break
end
end
end
if os.difftime(os.time(), session_start) > session_time then -- just to reduce the script to every second
session_time = os.difftime(os.time(), session_start)
session_d_float = session_time / 60 / 60 / 24
session_d = math.floor(session_d_float)
session_h = math.floor((session_d_float - session_d)*24)
session_m = math.floor(((session_d_float - session_d)*24 - session_h) * 60)
session_s = math.floor((((session_d_float - session_d)*24 - session_h) * 60 - session_m) * 60)
xpgain = me.xp - session_start_xp
xps = xpgain/session_time
if me.age-session_start_age > 0 then
xpmin = xpgain/(me.age-session_start_age)
else
xpmin = 0
end
xptolvl = req_xp[current_level + 1] - me.xp
xpto1k = req_xp[1000] - me.xp
if xps > 0 then
timetolvl = xptolvl / xps
timeto1k = xpto1k / xps
else
timetolvl = 0
timeto1k = 0
end
timetolvl_d_float = timetolvl / 60 / 60 / 24
timetolvl_d = math.floor(timetolvl_d_float)
timetolvl_h = math.floor((timetolvl_d_float - timetolvl_d)*24)
timetolvl_m = math.floor(((timetolvl_d_float - timetolvl_d)*24 - timetolvl_h) * 60)
timetolvl_s = math.floor((((timetolvl_d_float - timetolvl_d)*24 - timetolvl_h) * 60 - timetolvl_m) * 60)
timeto1k_d_float = timeto1k / 60 / 60 / 24
timeto1k_d = math.floor(timeto1k_d_float)
timeto1k_h = math.floor((timeto1k_d_float - timeto1k_d)*24)
timeto1k_m = math.floor(((timeto1k_d_float - timeto1k_d)*24 - timeto1k_h) * 60)
timeto1k_s = math.floor((((timeto1k_d_float - timeto1k_d)*24 - timeto1k_h) * 60 - timeto1k_m) * 60)
end
--auxbox_prop_line("Level" ,string.format("%.4f",lvl_float))
--auxbox_prop_line("Time" ,string.format("%02.f:%02.f:%02.f:%02.f", session_d, session_h, session_m, session_s))
--auxbox_prop_line("Current XP", string.format("%d", me.xp))
--auxbox_prop_line("Before Level", string.format("%d", xptolvl))
--auxbox_prop_line("XPgain" ,string.format("%d", xpgain))
--auxbox_prop_line("XP/s" ,string.format("%d", xps))
--auxbox_prop_line("XP/min" ,string.format("%d", xpmin))
--auxbox_prop_line("TimetoLvl" ,string.format("%02.f:%02.f:%02.f:%02.f", timetolvl_d, timetolvl_h, timetolvl_m, timetolvl_s))
--auxbox_prop_line("Timeto1k" ,string.format("%02.f:%02.f:%02.f:%02.f", timeto1k_d, timeto1k_h, timeto1k_m, timeto1k_s))
end
end
now, I have messed around with it as much as I possibly can, and I have successfully added a "Current Lvl" addon to the menu, but it doesn't work. I have looked it over many times, but I just can't figure out how to make it work. I've added this and added that, and nothing.
I'd like to get this look/feel using the "alt+m" menu.
__________ __________ __________ __________ __________
__________ __________ __________ __________ __________
as you see the in the picture, I can see my full level all the way out to the millionths place. I like being able to see this. the current xp, before level, xp/s, and xp/m is already in the menu and that's fine. I just want to be able to see my current level.
(not worried about the skills. my auxbox isn't that big with a 800x600 res anyway)
PLEASE HELP IF YOU CAN!!