Code: Select all
session_start = os.time() - 1
auxbox_next_line = 0
function auxbox()
d:auxbox_clear();
auxbox_next_line = 0
auxbox_real_world_time()
auxbox_blank_line()
auxbox_damage_per_second()
auxbox_blank_line()
auxbox_xp()
auxbox_blank_line()
auxbox_monk_conditionals()
auxbox_blank_line()
auxbox_f5_message()
end
function auxbox_prop_line(prop_name, prop_val)
local filler = string.rep(" ", 25 - string.len(prop_name) - string.len(prop_val))
auxbox_next_line = auxbox_next_line + 1
d:auxbox_set_line(auxbox_next_line, string.format("%s %s %s", prop_name, filler, prop_val))
end
function auxbox_blank_line()
auxbox_next_line = auxbox_next_line + 1
end
function auxbox_real_world_time()
auxbox_prop_line("Real World Time:", string.format(os.date("%I:%M%p")))
end
function auxbox_monk_conditionals()
if me:fists_or_fist_weapons() and me:is_unarmoured() then
auxbox_prop_line("Unarm/UA:", "True/True")
elseif not me:fists_or_fist_weapons() and me:is_unarmoured() then
auxbox_prop_line("Unarm/UA:", "False/True")
elseif me:fists_or_fist_weapons() and not me:is_unarmoured() then
auxbox_prop_line("Unarm/UA:", "True/False")
elseif not me:fists_or_fist_weapons() and not me:is_unarmoured() then
auxbox_prop_line("Unarm/UA:", "False/False")
end
end
-- Damage Per Second (by Severian)
-- starts displaying DPS after 35 hits, and gets more accurate the more hits you make
-- assumes few intervals walking and more intervals between continuous hits
VERBOSE_DPS_REPORT = true
last_dpst = g_dpst
hits_recorded = 0
dmg_log = {}
median_damage = -1
recent_hit_times = {}
five_hit_intervals = {}
median_interval = -1
function auxbox_damage_per_second()
local current_time
local current_dmg
local current_five_hit_interval
local temp_var
local temp_five_hit_intervals
local temp_dmg_log
if last_dpst ~= g_dpst then
current_time = os.time()
current_dmg = g_dpst - last_dpst
hits_recorded = hits_recorded + 1
if hits_recorded <= 30 then -- first 30 hits
table.insert(dmg_log, 1, current_dmg)
else -- on and after the 31st hit
table.remove(dmg_log, 30)
table.insert(dmg_log, 1, current_dmg)
end
last_dpst = g_dpst
if hits_recorded < 6 then -- first 5 hits
table.insert(recent_hit_times, 1, current_time)
else -- on and after the 6th hit
table.remove(recent_hit_times, 5)
table.insert(recent_hit_times, 1, current_time)
end
if hits_recorded >= 5 then
current_five_hit_interval = recent_hit_times[1] - recent_hit_times[5]
if hits_recorded <= 35 then -- first 30 "5 hit" intervals
table.insert(five_hit_intervals, 1, current_five_hit_interval)
else -- on and after the 31st "5 hit" interval
table.remove(five_hit_intervals, 30)
table.insert(five_hit_intervals, 1, current_five_hit_interval)
end
end
end
if hits_recorded < 35 then
temp_var = 35 - hits_recorded
auxbox_prop_line("DPS:", string.format("...in %d hits...", temp_var))
if VERBOSE_DPS_REPORT then auxbox_prop_line("Median Damage:", "") end
if VERBOSE_DPS_REPORT then auxbox_prop_line("Median 5-Hit Time:", "") end
else
temp_dmg_log = {}
for i,v in pairs(dmg_log) do
temp_dmg_log[i] = v
end
table.sort(temp_dmg_log)
temp_five_hit_intervals = {}
for i,v in pairs(five_hit_intervals) do
temp_five_hit_intervals[i] = v
end
table.sort(temp_five_hit_intervals)
median_damage = math.ceil((temp_dmg_log[15] + temp_dmg_log[16]) / 2)
median_interval = math.floor((temp_five_hit_intervals[15] + temp_five_hit_intervals[16]) / 2)
temp_var = math.floor((median_damage * 5) / median_interval)
auxbox_prop_line("DPS:", string.format("%d", temp_var))
if VERBOSE_DPS_REPORT then
auxbox_prop_line("Median Damage:", string.format("%d", median_damage))
end
if VERBOSE_DPS_REPORT then
auxbox_prop_line("Median 5-Hit Time:", string.format("%d", median_interval))
end
end
end
function auxbox_f5_message()
auxbox_prop_line("Press F5 to Reset", "")
end
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 auxbox_xp()
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("%f",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("XP to 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 per Minute:" ,string.format("%d", xpmin))
auxbox_prop_line("Time to Level:" ,string.format("%02.f:%02.f:%02.f:%02.f", timetolvl_d, timetolvl_h, timetolvl_m, timetolvl_s))
--auxbox_prop_line("Time to L1000:" ,string.format("%02.f:%02.f:%02.f:%02.f", timeto1k_d, timeto1k_h, timeto1k_m, timeto1k_s))
end
end
Code: Select all
auxbox_next_line = 0
session_time = 0
sessionstart = os.time()
shiftkeys={"Shift","Alt","Ctrl+Shift","Shift+Alt","Ctrl+Alt","Ctrl+Alt+Shift"}
player_xp=me.xp
player_currentlvl=me.lvl
player_lastxp=0
player_startxp=player_xp
--player_session_minutes = 0
--player_xp_p_min = 0
player_xp_next_level = 0
player_xp_p_fmin = 0
player_xp_p_tmin = 0
player_xp_lasttickxp = me.xp
player_lasttick= 0
player_xp_arr={}
for i=1,600 do
player_xp_arr[i]=0
end
-- XP 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
player_arga=0
player_argb=0
player_argc=0
player_arg1=0
player_arg2=0
player_arg3=true
function incargs()
for i=0x00,0xff do
if items:get_qty(make_code(1103,0,player_arg2,i)) == 175 then
player_arga=player_arg1
player_argb=player_arg2
player_argc=i
player_arg3=false
return
end
end
player_arg2=player_arg2+1
--if player_arg2==256 then
-- player_arg2=0
-- player_arg1=player_arg1+1
--end
if player_arg2==0xff then
player_arg3=false
return
end
end
function auxbox()
local w=d:auxbox_get_width()
local h=d:auxbox_get_height()
d:auxbox_clear()
auxbox_next_line = 0
if not d:ok_to_draw_play_window() then return; end
local cd=d:get_curr_display()
local mode=d:get_statbox_mode()
local lineNr=0
local txta=explode("\n", filterTextLines)
if cd==1 then
if mode==SELECT_ABILITY then
auxbox_prop_line("Hit F-key to bind currently")
auxbox_prop_line("selected spell")
auxbox_blank_line()
auxbox_ability_binds()
else
for i=1,#txta do
auxbox_prop_line(txta[i])
end
auxbox_blank_line()
auxbox_prop_line("Search with /")
if mode==SELECT_READY then
auxbox_prop_line("Press ENTER to equip")
elseif mode==SELECT_BUY then
auxbox_prop_line("Press ENTER to buy")
elseif mode==SELECT_BANK then
auxbox_prop_line("Press ENTER to transfer one")
auxbox_prop_line("Press Shift+ENTER for 10")
auxbox_prop_line("Press TAB for whole stack")
end
end
else
--auxbox_time() --Not really interesting
--auxbox_blank_line()
--auxbox_prop_line("XP TNL:", player_xp_next_level)
--auxbox_blank_line()
XP_Calc()
--auxbox_prop_line(me.id)
--auxbox_blank_line()
DPS_Calc()
--auxbox_blank_line()
Items_Left()
auxbox_blank_line()
auxbox_damage_per_second()
--auxbox_blank_line()
--auxbox_bound_item_basecodes()
--auxbox_prop_line(wl:get_full_name(make_code(1334,0xd,0x02,0x12)))
--auxbox_prop_line(wl:get_full_name(make_code(0x44f,0x0,0x00,0x0)))
--auxbox_prop_line("qty:", items:get_qty(make_code(0x44f,0x0,0x74,0x75)))
--testitem(make_code(0x1000044f,0x0,0x0,0))
--auxbox_prop_line(me.id)
--auxbox_prop_line(string.format("%.2f",STAT_VALUE))
--if player_arg3 then
-- auxbox_prop_line(string.format("%x %x",player_arg1,player_arg2))
-- incargs()
--end
--auxbox_prop_line(string.format("%x %x %x",player_arga,player_argb,player_argc))
--if d:numlock() then
--auxbox_blank_line()
--auxbox_prop_line("Please turn numlock off!")
--end
--auxbox_blank_line()
--auxbox_prop_line("F12 for main menu.")
--auxbox_blank_line()
--auxbox_f5_message()
end
end
function testitem(code)
auxbox_prop_line(wl:get_full_name(code))
auxbox_prop_line(items:get_qty(code))
end
--
--make_code(basecode,material,arg1,arg2)
--arg1: 1-14 affix arg2=quantity
--arg1: 0 magic ench, arg2= spell id
--arg1: 15 prefix, arg2=quality (improved,refined,greater,superior,magic,enchanted,etc.)
--
--
--
--arg2: for meat - 0x1? charred, 0x2?, roasted, 0x?1 item, 0x?2 mob, 0x?3 mob.
--if the first bit is 1, it'll be cursed
--continues into arg1 and material. probably makes more sense if you look at the finished item code.
--probably assembles it like thus: 0xBBB2211MM --- actually 0x2211MMBBB?
--
--
--
-- Color codes:
-- 16(0x10) - white
-- 17(0x11) - yellow(?) tinted white
-- 18(0x12) - light blue
-- 19(0x13) - red
-- 20(0x14) - light orange
-- 21(0x15) - light green
-- 22(0x16) - light purple/pink
-- 23(0x17) - cyan(?)
-- 24(0x18) - gray(dark, ie. log in/out messages)
-- 25(0x19) - orange
-- 26(0x1A) - living (light) green
-- 27(0x1B) - Yellow
-- 28(0x1C) - Purple
-- 29(0x1D) - green
-- 30(0x1E) - green
-- 31(0x1F) - Runic alphabet
--
function auxbox_bound_item_basecodes()
local item
local name
for i = 1, 50 do
item = me.item_binds[i]
name = wl:get_full_name(item)
if item
and not wl:is_tool(item)
and name ~= "NOTHING"
then
--auxbox_prop_line(lua_gettable(item,1))
--auxbox_prop_line(array.get(item,5))
auxbox_prop_line(name, get_base_code(item))
end
end
end
function XP_Calc()
if player_xp<me.xp then
player_lastxp=me.xp-player_xp
player_xp=me.xp
end
--if player_lastxp > 50000
--or player_lastxp < 0 then
-- player_current_lvl = me.lvl
-- player_last_xp = 0
-- return
--end
if (os.difftime(os.time(), player_lasttick)>=1) then --We need to run this once per second
--player_session_minutes = (os.difftime(os.time(), sessionstart)/60)
--player_xp_p_min = math.floor(((player_startxp-player_xp)*-1)/player_session_minutes)
player_xp_next_level = (req_xp[(player_currentlvl+1)]-me.xp)
if player_xp_next_level < 0 then
player_currentlvl = player_currentlvl + 1
end
local xpperminuteftotal = 0
local xpperminutettotal = 0
for i=1,300 do --5 to 10 minutes back
player_xp_arr[(600-(i-1))]=player_xp_arr[(600-i)]
xpperminutettotal=xpperminutettotal+player_xp_arr[(600-(i-1))]
end
for i=1,299 do --0 to 5 minutes back
player_xp_arr[(300-(i-1))]=player_xp_arr[(300-i)]
xpperminuteftotal=xpperminuteftotal+player_xp_arr[(300-(i-1))]
end
player_xp_arr[1]=me.xp-player_xp_lasttickxp
xpperminuteftotal=xpperminuteftotal+player_xp_arr[1]
xpperminutettotal=xpperminutettotal+xpperminuteftotal
player_xp_p_fmin = math.floor(xpperminuteftotal/5)
player_xp_p_tmin = math.floor(xpperminutettotal/10)
player_xp_lasttickxp = me.xp
player_lasttick=os.time()
end
--auxbox_prop_line("XP TNL:", player_xp_next_level)
--auxbox_prop_line("XP/min (session):",string.format("%d(%d min)",player_xp_p_min,math.floor(player_xp_next_level/player_xp_p_min)))
--auxbox_prop_line("XP/min (10 mins):",string.format("%d(%d)",player_xp_p_tmin,math.floor(player_xp_next_level/player_xp_p_tmin)))
--auxbox_prop_line("XP/min (5 mins):",string.format("%d(%d)",player_xp_p_fmin,math.floor(player_xp_next_level/player_xp_p_fmin)))
--auxbox_prop_line("Last XP gain:", player_lastxp)
--auxbox_prop_line("Session time:", player_session_time)
end
function DPS_Calc()
local dwmindmg, dwmaxdmg, dwavgdmg
dwavgdmg = 0
local weapons = 1
--Should merge weap delay, stat dmg multiplier, total AS and AVG dmg.
--auxbox_prop_line("Weapon Delay:", me:get_weapon_delay())
--auxbox_prop_line("Stat DMG Multiplier:", me:stat_damage_multiplier())
--Merge material dmg multiplier and weapon modifier into avg dmg.
--auxbox_prop_line("mtrl dmg multi:", wl:get_material_dmg_mult(me.weapon,false))
--auxbox_prop_line("weap modifier:", get_modifier(me.weapon))
local offhand = wl:get_type(me.shield)
--auxbox_prop_line(wl:get_speed(me.weapon),wl:get_speed(me.shield))
if offhand == 87
then
dwmindmg = math.floor((wl:get_no_dice(me.shield)+get_modifier(me.shield))*wl:get_material_dmg_mult(me.shield,false))
dwmaxdmg = math.floor(((wl:get_no_sides(me.shield)*wl:get_no_dice(me.shield))+get_modifier(me.shield))*wl:get_material_dmg_mult(me.shield,false))
dwavgdmg = (dwmindmg+dwmaxdmg)/2
weapons=2
end
local mindmg = math.floor((me:get_dmg_dice()+get_modifier(me.weapon))*wl:get_material_dmg_mult(me.weapon,false))
local maxdmg = math.floor(((me:get_dmg_sides()*me:get_dmg_dice())+get_modifier(me.weapon))*wl:get_material_dmg_mult(me.weapon,false))
local avgdmg = (mindmg+maxdmg)/2
local wrating = 0
--auxbox_prop_line("Mainhand AVG DMG:", avgdmg)
--auxbox_prop_line("Offhand AVG DMG:", dwavgdmg)
--equipped weapon(s) rating - first draft
--seems to overvalue fast weapons and undervalue dual wield
--local wrating = (((avgdmg+dwavgdmg)*me:stat_damage_multiplier())+me:get_thaco())*(1000/me:get_weapon_delay())
--equipped weapon(s) rating - second draft
--seems to better, now only to withdraw the weapon modifiers from thaco - or should I?
--wrating = (((avgdmg+dwavgdmg)*me:stat_damage_multiplier())+(me:get_thaco()*weapons))*(1000/me:get_weapon_delay())
--equipped weapon(s) rating - third draft
--This now assumes that you're wielding your weapon in your weapon slot and then your shield slot.
--Maybe I should do each weapon individually and then add them together?
if weapons == 1 then
wrating = (((avgdmg+dwavgdmg)*me:stat_damage_multiplier())+((me:get_thaco()-get_modifier(me.weapon))*weapons))*(1000/me:get_weapon_delay())
else
wrating = (((avgdmg+dwavgdmg)*me:stat_damage_multiplier())+((me:get_thaco()-get_modifier(me.weapon)-get_modifier(me.shield))*weapons))*(1000/me:get_weapon_delay())
end
--auxbox_prop_line("Weapon rating:", string.format("%0.f",wrating))
end
function Items_Left()
auxbox_prop_line(" Potions:")
auxbox_prop_line("Mega Yellow Potions:", items:get_qty_basecode(363))
auxbox_prop_line("Greater Yellow Potions:", items:get_qty_basecode(260)) --matches with ALL yellow potions, should use make_code(260,0,15,3), leaving it for alts
auxbox_prop_line("Mega Blue Potions:", items:get_qty_basecode(364))
auxbox_prop_line("Blue Potions:", items:get_qty_basecode(261))
auxbox_prop_line("Purple Potions:", items:get_qty_basecode(360))
--auxbox_prop_line("Khaki Potions:", items:get_qty_basecode(380))
--auxbox_prop_line("White Potions:", items:get_qty_basecode(354))
--auxbox_prop_line("Cyan Potions:", items:get_qty_basecode(356))
--auxbox_prop_line("Orange Potions:", items:get_qty_basecode(355))
auxbox_prop_line("Brown Potions:", items:get_qty_basecode(358))
auxbox_blank_line()
--auxbox_prop_line(" Food:")
auxbox_blank_line()
auxbox_prop_line(" Scrolls:")
--auxbox_prop_line("Scroll of Health:", items:get_qty_basecode(1298)) --should use make_code(1298,0,15,3)
--auxbox_prop_line("Scroll of Protection:", items:get_qty_basecode(1297))
--auxbox_prop_line("Scroll of Galvinising:",items:get_qty_basecode(1484))
--auxbox_prop_line("Scroll - VL", items:get_qty(make_code(286,0,0,4))) --286
auxbox_prop_line("Sanct Lor:", items:get_qty(make_code(286,0,0,18)))
auxbox_prop_line("Kal Ort Por:", items:get_qty(make_code(286,0,0,13)))
auxbox_prop_line("Town Portal:", items:get_qty_basecode(293))
auxbox_prop_line("Greater Health:", items:get_qty_basecode(12))
auxbox_blank_line()
auxbox_prop_line("Soul Shards:", items:get_qty_basecode(1283))
auxbox_prop_line("Omelettes:", items:get_qty_basecode(1380))
auxbox_blank_line()
--auxbox_prop_line("Scrolls of Uncurse:", items:get_qty_basecode(315))
--auxbox_prop_line("Black Potions:", items:get_qty_basecode(352))
--auxbox_prop_line(" \24Other:")
--auxbox_prop_line("Bandages:", items:get_qty_basecode(375))
--auxbox_prop_line("Wonderous Fish:", items:get_qty(make_code(279,7,0,0))) --279
--auxbox_prop_line("Charred Blue Dragon", items:get_qty(make_code(1334,0xd,0x02,0x12)))
--auxbox_prop_line("Superior Lava Fish", items:get_qty(make_code(279,4,15,4)))
--auxbox_prop_line("Dragon Rations:", items:get_qty_basecode(1399))
--auxbox_prop_line(" \24Coins:")
--auxbox_blank_line()
auxbox_prop_line(" Coins:")
auxbox_prop_line("Adamantium coins:", items:get_qty(make_code(0x1000044f,0x0,0x0,0))) --make_code(0x1000044f,0x0,0x0,0) need to figure out the code for soulbound(?)
auxbox_prop_line("Crystal coins:", items:get_qty(make_code(0x1000f5ca,0x0,0x0,0x0))) -- won't match because of it's soulbound(?)
auxbox_prop_line("Glass coins:", items:get_qty(make_code(0x1000d5ca,0x0,0x0,0x0)))
auxbox_prop_line("Silver Coins:", items:get_qty_basecode(1482))
end
-- explode(seperator, string)
-- from http://lua-users.org/wiki/SplitJoin
function explode(d,p)
local t, ll
t={}
ll=0
if(#p == 1) then return p end
while true do
l=string.find(p,d,ll+1,true) -- find the next d in the string
if l~=nil then -- if "not not" found then..
table.insert(t, string.sub(p,ll,l-1)) -- Save it in our array.
ll=l+1 -- save just after where we found it for searching next time.
else
table.insert(t, string.sub(p,ll)) -- Save what's left in our array.
break -- Break at end, as it should be, according to the lua manual.
end
end
return t
end
-- Real World Time - Duncan (PD) / Zen (Reg) / Brentoboy (forums)
function auxbox_time()
auxbox_prop_line("Real World Time:", string.format(os.date("%I:%M%p")))
if os.difftime(os.time(), sessionstart) > session_time then -- just to reduce the script to every second
session_time = os.difftime(os.time(), sessionstart)
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)
end
if session_d~=nil then
auxbox_prop_line("Session time:", string.format("%02.f:%02.f:%02.f:%02.f", session_d, session_h, session_m, session_s))
end
end
function auxbox_f5_message()
auxbox_prop_line("Press Alt-F5 to Reset", "")
end
function auxbox_prop_line(prop_name, prop_val)
local pvl=0
if prop_name==nil then prop_name="" end
if prop_val==nil then prop_val="" end
local filler = string.rep(" ", 25 - string.len(prop_name) - string.len(prop_val))
auxbox_next_line = auxbox_next_line + 1
d:auxbox_set_line(auxbox_next_line, string.format("%s %s %s", prop_name, filler, prop_val))
end
function auxbox_blank_line()
auxbox_next_line = auxbox_next_line + 1
end
function auxbox_ability_binds()
local cnt=0
for i=10,15 do
if me.spell_binds[i]~=-1 then
auxbox_prop_line(shiftkeys[i-9],spells:get_full_spell_name(me.spell_binds[i]))
cnt=cnt+1
end
end
return cnt
end
--- Damage Per Second -- original script provided by LordMortiferus
last_session_seconds = 0
last_5_dpst = { g_dpst, g_dpst, g_dpst, g_dpst, g_dpst }
last_5_dtpst = { g_dtpst, g_dtpst, g_dtpst, g_dtpst, g_dtpst }
last_dpst = g_dpst
recent_dmg = { 0, 0, 0, 0, 0 }
function auxbox_damage_per_second()
local session_seconds = os.time() - sessionstart
if session_seconds > last_session_seconds then
last_session_seconds = session_seconds
last_5_dpst[5] = last_5_dpst[4]
last_5_dpst[4] = last_5_dpst[3]
last_5_dpst[3] = last_5_dpst[2]
last_5_dpst[2] = last_5_dpst[1]
last_5_dpst[1] = g_dpst
last_5_dpst[5] = last_5_dpst[4]
last_5_dpst[4] = last_5_dpst[3]
last_5_dpst[3] = last_5_dpst[2]
last_5_dpst[2] = last_5_dpst[1]
last_5_dpst[1] = g_dtpst
end
if last_dpst ~= g_dpst then
recent_dmg[5] = recent_dmg[4]
recent_dmg[4] = recent_dmg[3]
recent_dmg[3] = recent_dmg[2]
recent_dmg[2] = recent_dmg[1]
recent_dmg[1] = g_dpst - last_dpst
last_dpst = g_dpst
end
--auxbox_prop_line("Dmg Dealt / Sec", string.format("%d", (last_5_dpst[1] - last_5_dpst[4]) / 4
--auxbox_prop_line("Dmg Taken / Sec", string.format("%d", (last_5_dtpst[1] - last_5_dtpst[4]) / 4)
auxbox_prop_line("Last 5 Hits:", "")
auxbox_prop_line("", string.format("%d %d %d %d %d", recent_dmg[5],recent_dmg[4], recent_dmg[3], recent_dmg[2], recent_dmg[1]))
end