Completed Auxbox Codes

Moderator: EUO Moderators

Completed Auxbox Codes

Postby CIAassassin » Fri Jun 07, 2013 11:28 am

This topic is simply to have all of the completed code in one spot. I will go through the other thread and pull out the completed codes and put it here so it will be easy to find with a search. Please do not reply in this thread, or ask for anything. Use the Custom Auxbox Creations topic to post any requests and work in progress codes. If the code is yours please PM me and let me know if there is not proper credit given and I will add it in. Lets try and keep this topic thread as clean as possible.

note: I am going to cut through some of the fluff code and post standalone functions into this topic, none of these are full auxbox creations. This topic is intended for people who know how to add code functions into their auxbox, but don't want to clean out someone elses creation to tailor it to their needs.

Protips: duplicate lines means you only need one per auxbox, eg "d:auxbox_clear()". Adding the function you want in the function_auxbox() area will run the function in that order, so you can copy and paste the body of the code anywhere and dictate when it runs at the top. Anything in " " can be changed.

Alternate method to get some of the codes listed here is to use Chedichs code compiler GOES OFFLINE WHEN HE GOES TO SLEEP
Last edited by CIAassassin on Sat Jun 08, 2013 10:24 pm, edited 5 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

Opening Code

Postby CIAassassin » Fri Jun 07, 2013 11:31 am

This sets up the rest of the Auxbox, and has all of the needed information to start and use the auxbox without errors.
Code: Select all
    session_start = os.time() - 1
   function auxbox()
        d:auxbox_clear();
   auxbox_next_line = 0
        auxbox_blank_line()
    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
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

Real World Time

Postby CIAassassin » Fri Jun 07, 2013 11:33 am

Shows just the real world time.
Code: Select all
       
       session_start = os.time() - 1
       function auxbox()
          d:auxbox_clear();
          auxbox_next_line = 0
          auxbox_real_world_time()
       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
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:11 am, edited 2 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[Severian] DPS Code (Early Version- Update needed)

Postby CIAassassin » Fri Jun 07, 2013 11:38 am

Code: Select all
   
     session_start = os.time() - 1
   function auxbox()
          d:auxbox_clear();
     auxbox_next_line = 0
     auxbox_damage_per_second()
        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

    -- 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
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:12 am, edited 2 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[Ched/LordM/Brent0] XP/min (Most Recent)

Postby CIAassassin » Fri Jun 07, 2013 11:42 am

Note: Cheds website pastes in a weird order, the auxbox() call function is at the bottom instead of the top. Just keep that in mind when trying to splice together this code and other codes. This code is by Ched, LordM and Brent contributions stop at the xp array.
Code: Select all
-- Automaticly compiled client script for EUO
-- Containing:
-- XP/min by Chedich
-- 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

ched_init=true
ched_xp_arr={}

function ched_xp_init()
   if ched_init then
      ched_xp=me.xp
      ched_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_lasttick = 0
      ched_lastname=me.name
      ched_init=false

      for i=1,600 do
         ched_xp_arr[i]=0
      end
   end
end
function auxbox_ched_xppmin()
   if ched_xp<me.xp then
      ched_lastxp=me.xp-ched_xp
      ched_xp=me.xp
   end
   if ched_init then
      return
   end
   if ched_lastxp == me.xp
   or ched_lastname ~= me.name then
      ched_init=true
      ched_xp_init()
   end
      
   if (os.difftime(os.time(), ched_lasttick)>0) then --We need to run this once per second
      ched_xp_next_level = (req_xp[(ched_currentlvl+1)]-me.xp)
      if ched_xp_next_level < 0 then --To account for non-meditated levels
         ched_currentlvl = ched_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
      ched_lasttick=os.time()
   end
   

   auxbox_prop_line("XP to next level:", ched_xp_next_level)
   auxbox_prop_line("XP/min (10 mins):",string.format("%d(%d)",ched_xp_p_tmin,math.floor(ched_xp_next_level/ched_xp_p_tmin)))
   auxbox_prop_line("XP/min (5 mins):",string.format("%d(%d)",ched_xp_p_fmin,math.floor(ched_xp_next_level/ched_xp_p_fmin)))
   auxbox_prop_line("Last XP gain:", ched_lastxp)
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
 
   ched_xp_init()
   local cd=d:get_curr_display()
   if cd~=1 then
auxbox_ched_xppmin()

   end
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 is left in our array.
        break -- Break at end, as it should be, according to the lua manual.
      end
    end
  return t
end

session_time = 0
sessionstart = os.time()

function auxbox_prop_line(prop_name, prop_val)
   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
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:12 am, edited 4 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[Chedich/CIA] Item Codes / Items Left

Postby CIAassassin » Fri Jun 07, 2013 11:50 am

Chedich did the heavy lifting of the items left creation, I went in and cleaned up the item codes and added a few.

Code: Select all
    session_start = os.time() - 1
   function auxbox()
      d:auxbox_clear();
     auxbox_next_line = 0
     Items_Left()
    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_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))

        function Items_Left()
         auxbox_prop_line("Purple Potions:", items:get_qty_basecode(0x168))
         auxbox_prop_line("Khaki Potions:", items:get_qty_basecode(0x17c))
         auxbox_prop_line("White Potions:", items:get_qty_basecode(0x162))
         auxbox_prop_line("Cyan Potions:", items:get_qty_basecode(0x164))
         auxbox_prop_line("Orange Potions:", items:get_qty_basecode(0x163))
         auxbox_prop_line("Brown Potions:", items:get_qty_basecode(0x166))
         auxbox_prop_line("Blue Potions:", items:get_qty(make_code(0x105, 0, 0, 0)))
         auxbox_prop_line("Improved Blue:", items:get_qty(make_code(0x105, 0, 15, 1)))
         auxbox_prop_line("Refined Blue:", items:get_qty(make_code(0x105, 0, 15, 2)))
         auxbox_prop_line("Greater Blue:", items:get_qty(make_code(0x105, 0, 15, 3)))
         auxbox_prop_line("Mega Blue Potions:", items:get_qty_basecode(0x16c))
         auxbox_prop_line("Yellow Potions:", items:get_qty(make_code(0x104, 0, 0, 0)))
         auxbox_prop_line("Improved Yellow:", items:get_qty(make_code(0x104, 0, 15, 1)))
         auxbox_prop_line("Refined Yellow:", items:get_qty(make_code(0x104, 0, 15, 2)))
         auxbox_prop_line("Greater Yellow:", items:get_qty(make_code(0x104, 0, 15, 3)))
         auxbox_prop_line("Mega Yellow Potions:", items:get_qty_basecode(0x16b))
         auxbox_prop_line("Reinforced Flask:", items:get_qty_basecode(0x16a))
         auxbox_prop_line("Flask:", items:get_qty_basecode(0x14f))
         auxbox_prop_line("Black Potions:", items:get_qty_basecode(0x160))
         auxbox_prop_line("Alembic:", items:get_qty_basecode(0x155))
         auxbox_prop_line("Spiders Silk:", items:get_qty_basecode(0x14c))
         auxbox_prop_line("Blood Moss:", items:get_qty_basecode(0x147))
         auxbox_prop_line("Ginseng:", items:get_qty_basecode(0x149))
         
         auxbox_prop_line("Quill:", items:get_qty_basecode(0x176))
         auxbox_prop_line("Blank Scrolls:", items:get_qty_basecode(0x41d))
         auxbox_prop_line("Scroll of Health:", items:get_qty(make_code(0x512, 0, 0, 0)))
         auxbox_prop_line("ISoH:", items:get_qty(make_code(0x512, 0, 15, 1)))
         auxbox_prop_line("RSoH:", items:get_qty(make_code(0x512, 0, 15, 2)))
         auxbox_prop_line("GSoH:", items:get_qty(make_code(0x512, 0, 15, 3)))
         auxbox_prop_line("Scroll of Protection:", items:get_qty_basecode(0x511))
         auxbox_prop_line("Scroll of Truesight:", items:get_qty_basecode(0x510))
         auxbox_prop_line("Town Portal:", items:get_qty_basecode(0x125))
         auxbox_prop_line("Ressurection Scroll:", items:get_qty_basecode(0x120))
         auxbox_prop_line("Scroll of Galvinising:", items:get_qty_basecode(0x5cc))
         auxbox_prop_line("Sanct Lor:", items:get_qty(make_code(0x11e, 0, 0, 18)))
         auxbox_prop_line("Vas Lor", items:get_qty(make_code(0x11e, 0, 0, 4)))
         auxbox_prop_line("In Mani Jux:", items:get_qty(make_code(0x11e, 0, 0, 43)))
         auxbox_prop_line("Kal Ort Por:", items:get_qty(make_code(0x11e, 0, 0, 13)))
         auxbox_prop_line("Kal Por Ylem:", items:get_qty(make_code(0x11e, 0, 0, 12)))
         
         auxbox_prop_line("Dragon Rations:", items:get_qty_basecode(0x577))
         auxbox_prop_line("Omelettes:", items:get_qty_basecode(0x564))
         
         auxbox_prop_line("Wand of Deconstruction:", items:get_qty_basecode(0x53b))
         auxbox_prop_line("Disenchanting Wand:", items:get_qty_basecode(0x516))
         auxbox_prop_line("Enchanting Wand:", items:get_qty_basecode(0x501))
         auxbox_prop_line("Polypile Wand:", items:get_qty_basecode(0x502))
         auxbox_prop_line("Wand of Petrification:", items:get_qty_basecode(0x564))
         
         auxbox_prop_line("Blackrock:", items:get_qty_basecode(0x156))
         auxbox_prop_line("Blackrock Ore:", items:get_qty(make_code(0x113, 0xc, 0, 0)))
         auxbox_prop_line("Silver Ore:", items:get_qty(make_code(0x113, 6, 0, 0)))
         auxbox_prop_line("Iron Ore:", items:get_qty(make_code(0x113, 2, 0, 0)))
         auxbox_prop_line("Copper Ore:", items:get_qty(make_code(0x113, 3, 0, 0)))
         auxbox_prop_line("Zinc Ore:", items:get_qty(make_code(0x113, 8, 0, 0)))
         auxbox_prop_line("Mithril Ore:", items:get_qty(make_code(0x113, 0x10, 0, 0)))
         auxbox_prop_line("Armourers Hammer:", items:get_qty_basecode(0x157))
         auxbox_prop_line("Smiths Hammer", items:get_qty_basecode(0x11f))
         auxbox_prop_line("Blackrock Ingot:", items:get_qty(make_code(0x118, 0xc, 0, 0)))
         auxbox_prop_line("Silver Ingot:", items:get_qty(make_code(0x118, 6, 0, 0)))
         auxbox_prop_line("Iron Ingot:", items:get_qty(make_code(0x118, 2, 0, 0)))
         auxbox_prop_line("Copper Ingot:", items:get_qty(make_code(0x118, 3, 0, 0)))
         auxbox_prop_line("Zinc Ingot:", items:get_qty(make_code(0x118, 8, 0, 0)))
         auxbox_prop_line("Brass Ingot:", items:get_qty(make_code(0x118, 4, 0, 0)))
         auxbox_prop_line("Venomous Ingot:", items:get_qty(make_code(0x118, 0xa, 0, 0)))
         auxbox_prop_line("Gold Ingot:", items:get_qty(make_code(0x118, 7, 0, 0)))
         auxbox_prop_line("Mithril Ingot:", items:get_qty(make_code(0x118, 0x10, 0, 0)))
         
         auxbox_prop_line("Tinkers Toolkit:", items:get_qty_basecode(0x152))
         auxbox_prop_line("Raw Glass:", items:get_qty_basecode(0x41b))
         auxbox_prop_line("Pole:", items:get_qty_basecode(0x410))
         auxbox_prop_line("Silver Sheet:", items:get_qty_basecode(0x40c))
         auxbox_prop_line("Brass Sheet:", items:get_qty_basecode(0x40d))
         
         auxbox_prop_line("Probes:", items:get_qty_basecode(0x141))
         auxbox_prop_line("Lockpicks:", items:get_qty_basecode(0x11c))
         auxbox_prop_line("Bandages:", items:get_qty_basecode(0x177))
         auxbox_prop_line("Skull Key:", items:get_qty_basecode(0x521))
         auxbox_prop_line("Arrow:", items:get_qty_basecode(0x128))
         auxbox_prop_line("Bullets:", items:get_qty_basecode(0x50e))
         auxbox_prop_line("Soul Shards:", items:get_qty_basecode(1283))
   
        end
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:12 am, edited 2 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

Str/Dex ratios

Postby CIAassassin » Fri Jun 07, 2013 11:58 am

All of them do the same thing, just have a different output. It's personal preference really, but I have them here for you.

TheCrusher Code:
Code: Select all
    session_start = os.time() - 1
   function auxbox()
      d:auxbox_clear();
     auxbox_next_line = 0
     stat_percent()
    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 stat_percent()
stra = me:get_str()
dexa = me:get_dex()
strengthaa = (stra/(stra+dexa)*100)
dexteritya = (dexa/(stra+dexa)*100)

auxbox_prop_line("Strength %:", math.floor(strengthaa) )
auxbox_prop_line("Dexterity %:", math.floor(dexteritya) )
end


LordM Code:
Code: Select all
        session_start = os.time() - 1
       function auxbox()
            d:auxbox_clear();
            auxbox_next_line = 0
         LM_auxbox_strdex_ratio()
            auxbox_blank_line()
        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 LM_auxbox_strdex_ratio()
  local strpct = (me:get_str()/(me:get_str()+me:get_dex())*100)
  local dexpct = (me:get_dex()/(me:get_str()+me:get_dex())*100)
  auxbox_prop_line("Str : Dex", string.format("%.2f : %.2f",strpct,dexpct))
end


Chedich Code:
Code: Select all
        session_start = os.time() - 1
       function auxbox()
            d:auxbox_clear();
            auxbox_next_line = 0
         ched_strdex_ratio()
            auxbox_blank_line()
        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 ched_strdex_ratio()
  local str = string.format("%.1f", (me:get_str()/(me:get_str()+me:get_dex()))*100)
  local dex = 100-str
  auxbox_prop_line("STR/DEX:", str.."%/"..dex.."%")
end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:13 am, edited 2 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[BrentoBoy/LordM] Last 4 hits dps/dmg taken (Original)

Postby CIAassassin » Fri Jun 07, 2013 12:13 pm

Code: Select all
    session_start = os.time() - 1
    auxbox_next_line = 0

    function auxbox()
       
       d:auxbox_clear();
       auxbox_next_line = 0       
      auxbox_damage_per_second() 
    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

    --- Damage Per Second -- original script proveded by LordMortiferus
    last_session_seconds = 0
    last_4_dpst = { g_dpst, g_dpst, g_dpst, g_dpst }
    last_4_dtpst = { g_dtpst, g_dtpst, g_dtpst, g_dtpst }
    last_dpst = g_dpst
    recent_dmg = { 0, 0, 0, 0 }

    function auxbox_damage_per_second()
       local session_seconds = os.time() - session_start
       
       if session_seconds > last_session_seconds then
          last_session_seconds = session_seconds
          last_4_dpst[4] = last_4_dpst[3]
          last_4_dpst[3] = last_4_dpst[2]
          last_4_dpst[2] = last_4_dpst[1]
          last_4_dpst[1] = g_dpst   

          last_4_dtpst[4] = last_4_dtpst[3]
          last_4_dtpst[3] = last_4_dtpst[2]
          last_4_dtpst[2] = last_4_dtpst[1]
          last_4_dtpst[1] = g_dtpst   
       end
       
       if last_dpst ~= g_dpst then
          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_4_dpst[1] - last_4_dpst[4])  / 4))
       auxbox_prop_line("Dmg Taken / Sec", string.format("%d", (last_4_dtpst[1] - last_4_dtpst[4])  / 4))
       auxbox_prop_line("Recent Dmg Dealt", "")
       auxbox_prop_line("", string.format("%d  %d  %d  %d", recent_dmg[4], recent_dmg[3], recent_dmg[2], recent_dmg[1]))
    end

You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:14 am, edited 6 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[BrentBoy] Moon Phase

Postby CIAassassin » Fri Jun 07, 2013 1:57 pm

Code: Select all
    session_start = os.time() - 1
    auxbox_next_line = 0

    function auxbox()
       d:auxbox_clear();
       auxbox_next_line = 0
       auxbox_moon_info()   
    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

    -- Moon Info - Duncan (PD) / Zen (Reg) / Brentoboy (forums)
    function auxbox_moon_info()
       if world_time < 9 * 60 -- if its night time
       or world_time > 21 * 60
       then
          auxbox_prop_line("Moon Phase:", string.format("%d", moon_phase))
          -- if moon_phase = full and is_night = true say "FULL MOON"
          -- if moon_phase = new ... "New Moon"
       end
       if world_time < 60 then -- between 12am and 1am
          auxbox_prop_line("ITS MIDNIGHT", "(*)")
       end
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:17 am, edited 1 time in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[BrentoBoy] Bound Item Quantity

Postby CIAassassin » Sat Jun 08, 2013 6:35 am

Code: Select all
    session_start = os.time() - 1
    auxbox_next_line = 0

    function auxbox()
       d:auxbox_clear();
       auxbox_next_line = 0       
      auxbox_bound_item_qtys()
    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_bound_item_qtys()
       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(name, items:get_qty(item))
          end
       end
    end

You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:14 am, edited 2 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[BrentoBoy] All Skill Level (Dynamic)

Postby CIAassassin » Sat Jun 08, 2013 6:45 am

Code: Select all
    session_start = os.time() - 1
    auxbox_next_line = 0

    function auxbox()
       
       d:auxbox_clear();
       auxbox_next_line = 0       
       update_skill_experience()
       auxbox_all_skill_levels()
    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


    -- Skill level stuff - Duncan (PD) / Zen (Reg) / Brentoboy (forums)
    skill_count = 40

    auxbox_class_skills =
    {   0, 1, 2, 3, 26 --fighter
    ,   17, 18, 13, 14, 15, 9   --thief
    ,   7, 33 -- mage
    ,   34, 38, 36  -- priest
    ,   10, 40 -- monk
    }

    auxbox_crafting_skills =
    {   4
    ,   5
    ,    6
    ,   8
    ,   11
    ,   12
    ,   16
    ,   19
    ,   20
    ,   21, 22, 23, 24, 25
    ,   27, 28
    ,   29
    ,   30
    ,   31, 32
    ,   35, 37
    ,   39
    }

    auxbox_prev_skill_values = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    auxbox_skill_last_updated = {-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1}
    auxbox_prev_skill_values[0] = -1
    auxbox_skill_last_updated[0] = -1

    auxbox_skill_names =
    {    "polearms" -- 1
    ,   "maces" -- 2
    ,   "tactics" -- 3
    ,   "woodcrafting" --4
    ,   "mining" -- 5
    ,   "weaponsmith" -- 6
    ,   "magery" -- 7
    ,   "fishing" -- 8
    ,   "locks" --9
    ,   "unarmed" --10
    ,   "meditation" -- 11
    ,   "alchemy" --12
    ,   "ranged" --13
    ,   "stealth" --14
    ,   "traps" --15
    ,   "item lore" --16
    ,   "shortswords" --17
    ,   "foils" -- 18
    ,   "Skill 19"
    ,   "tailoring" --20
    ,   "tinkering" -- 21
    ,   "Skill 22"
    ,   "Skill 23"
    ,   "Skill 24"
    ,   "Skill 25"
    ,   "block" --26
    ,   "cartography" --27
    ,   "healing" --28
    ,   "enchanting"  --29
    ,   "armourer" -- 30
    ,   "inscription" --31
    ,   "taming" --32
    ,   "sorcery" --33
    ,   "piety" --34
    ,   "Skill 35"
    ,   "blessed maces" --36
    ,   "staves" -- 37
    ,   "divinity" --38
    ,   "cooking" --39
    ,   "sanctity" --40
    }
    auxbox_skill_names[0] = "longswords"

    function auxbox_skill_line(skill_index)
       if me:get_skill(skill_index) > 0
       and me:get_skill(skill_index) < 100
       then
          auxbox_prop_line(auxbox_skill_names[skill_index], string.format("%.3f%%", me:get_skill(skill_index)))
       end   
    end

    -- I used this for debugging, its pretty similar to the skill tab, so kind of pointless, but why delete it, now that it works
    function auxbox_all_skill_levels()
       for i = 0, skill_count do
          auxbox_skill_line(i)
       end
    end

    -- you have to call this before either of the two functions below it or they wont know what has recently changed
    function update_skill_experience()
       for i = 0, skill_count do
          if auxbox_prev_skill_values[i] < me:get_skill(i) then
             auxbox_skill_last_updated[i] = auxboxcnt
             auxbox_prev_skill_values[i] = me:get_skill(i)
          end
       end
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:14 am, edited 3 times in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[LordM] Last 5 Hits (Most Recent- No Dmg Taken)

Postby CIAassassin » Sat Jun 08, 2013 9:57 pm

Code: Select all
    auxbox_next_line = 0

    function auxbox()
      d:auxbox_clear();
      auxbox_next_line = 0
      auxbox_lm_last5hits()
    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

    last_dpst = g_dpst
    lm_5dmg_log = {0,0,0,0,0}
    function auxbox_lm_last5hits()
         
    local current_dmg
       
        if last_dpst ~= g_dpst then
        current_dmg = g_dpst - last_dpst
        table.insert(lm_5dmg_log, 1, current_dmg)
        last_dpst = g_dpst
       end

        if lm_5dmg_log[6] ~= nil then
            table.remove(lm_5dmg_log, 6)
        end
     
     auxbox_prop_line("Last 5 Hits:", "")
     auxbox_prop_line("", string.format("%4.f %4.f %4.f %4.f %4.f", lm_5dmg_log[5],lm_5dmg_log[4], lm_5dmg_log[3], lm_5dmg_log[2], lm_5dmg_log[1]))
     
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:15 am, edited 1 time in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[LordM] ASCII Map

Postby CIAassassin » Sat Jun 08, 2013 10:04 pm

Code: Select all
    auxbox_next_line = 0

    function auxbox()
      d:auxbox_clear();
      auxbox_next_line = 0
      auxbox_LM_ascii_map()
    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

     
      asciimap = {}

    function auxbox_LM_ascii_map()
     
      local tilexy = 0
     
      -- scan of xy-cords around player
      sx=me.x-10
      ex=me.x+10
      sy=me.y-10
      ey=me.y+10
       
       for yy=sy,ey do
          for xx=sx,ex do
            tilexy = tilexy + 1
           -- checks if player is near an edge of a map
             if yy < 0 or xx < 0 or yy > cmap:get_max_y() or xx > cmap:get_max_x() then
              table.insert (asciimap,tilexy," ")
             elseif yy == me.y and xx == me.x then -- marks the player as a X on the map
              table.insert (asciimap,tilexy,"X")
             elseif (cmap:is_mountain(xx,yy)) then
              table.insert (asciimap,tilexy,"A")
             elseif (cmap:is_forest(xx,yy)) then
              table.insert (asciimap,tilexy,"&")
             elseif (cmap:is_lava(xx,yy)) then
              table.insert (asciimap,tilexy,"L")
             elseif (cmap:is_swamp(xx,yy)) then
              table.insert (asciimap,tilexy,",")
             elseif (cmap:is_deep_water(xx,yy)) then
              table.insert (asciimap,tilexy,"~")
             elseif (cmap:is_void(xx,yy)) then
              table.insert (asciimap,tilexy," ")
             elseif (cmap:is_wet(xx,yy)) then
              table.insert (asciimap,tilexy,"~")
             elseif tiledata:is_blocking(cmap:get_tile(xx,yy))==true then
              table.insert (asciimap,tilexy,"#")
             else
              table.insert (asciimap,tilexy,".") -- for anything that is not defined above but can be seen
             end
          end

            if tilexy == 21 then
           tilexy = 0
                if yy == sy or yy == ey then
                   table.insert (asciimap,22," -10")
              elseif yy == sy+5 or yy == sy+15 then
               table.insert (asciimap,22," -5 ")
             elseif yy == sy+10 then
              table.insert (asciimap,22," -0 ")
              else
              table.insert (asciimap,22,"    ")
             end     
             auxbox_prop_line("", string.format("%s", table.concat(asciimap)))
              for i,v in pairs(asciimap) do
                 asciimap[i]=nil
               end
          end
       end
     
      auxbox_blank_line()
      auxbox_prop_line("","|    |    |    |    |    ")
      auxbox_prop_line("","10   5    0    5    10   ")
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:15 am, edited 1 time in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[LordM] ASCII Map (LoS)

Postby CIAassassin » Sat Jun 08, 2013 10:05 pm

Code: Select all
    auxbox_next_line = 0

    function auxbox()
      d:auxbox_clear();
      auxbox_next_line = 0
      auxbox_LM_ascii_map_LOS()
    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

     
      asciimap_LOS = {}

    function auxbox_LM_ascii_map_LOS()
     
      local tilexy = 0
      -- scan of xy-cords around player
      sx=me.x-10
      ex=me.x+10
      sy=me.y-10
      ey=me.y+10
     
        for yy=sy,ey do
          for xx=sx,ex do
            tilexy = tilexy + 1
           -- checks if player is near an edge of a map
             if yy < 0 or xx < 0 or yy > cmap:get_max_y() or xx > cmap:get_max_x() then
              table.insert (asciimap_LOS,tilexy," ")
             elseif cmap:can_see_with_LOS(me.x, me.y, xx, yy, me:get_sight())==false then
              table.insert (asciimap_LOS,tilexy," ")
             elseif cmap:can_see_with_LOS(me.x, me.y, xx, yy, me:get_sight())==true then
                 if yy == me.y and xx == me.x then -- marks the player as a X on the map
                  table.insert (asciimap_LOS,tilexy,"X")
                 elseif (cmap:is_mountain(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,"A")
                 elseif (cmap:is_forest(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,"&")
                 elseif (cmap:is_lava(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,"L")
                 elseif (cmap:is_swamp(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,",")
                 elseif (cmap:is_deep_water(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,"~")
                 elseif (cmap:is_void(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy," ")
                 elseif (cmap:is_wet(xx,yy)) then
                  table.insert (asciimap_LOS,tilexy,"~")
                 elseif tiledata:is_blocking(cmap:get_tile(xx,yy))==true then
                  table.insert (asciimap_LOS,tilexy,"#")
                 else
                  table.insert (asciimap_LOS,tilexy,".") -- for anything that is not defined above but can be seen
                 end
             end
          end

            if tilexy == 21 then
           tilexy = 0
                if yy == sy or yy == ey then
                   table.insert (asciimap_LOS,22," -10")
              elseif yy == sy+5 or yy == sy+15 then
               table.insert (asciimap_LOS,22," -5 ")
             elseif yy == sy+10 then
              table.insert (asciimap_LOS,22," -0 ")
              else
              table.insert (asciimap_LOS,22,"    ")
             end   
             
             auxbox_prop_line("", string.format("%s", table.concat(asciimap_LOS)))

              for i,v in pairs(asciimap_LOS) do
                 asciimap_LOS[i]=nil
               end
          end
       end
     
      auxbox_blank_line()
      auxbox_prop_line("","|    |    |    |    |    ")
      auxbox_prop_line("","10   5    0    5    10   ")
     
    end
You do not have the required permissions to view the files attached to this post.
Last edited by CIAassassin on Thu Jun 13, 2013 7:15 am, edited 1 time in total.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[LordM] DPS Calculator (most recent)

Postby CIAassassin » Sat Jun 08, 2013 10:06 pm

Code: Select all
    auxbox_next_line = 0

    function auxbox()
      auxbox_lm_dpscalc () -- has to be called always
      d:auxbox_clear();
      auxbox_next_line = 0
      auxbox_lm_time()           -- Total Time :       00:00:00
      auxbox_lm_hits()           -- Total Hits :            XXX
      auxbox_lm_kills()          -- Total Kills:            XXX
      auxbox_lm_xp_gained()      -- XP gained  :            XXX
      auxbox_lm_xpps()           -- XP/sec     :            XXX
      auxbox_lm_xppm()           -- XP/min     :            XXX
      auxbox_lm_dmg()            -- Total dmg  :            XXX
      auxbox_lm_dps()            -- Dps from total Values:  XXX
      auxbox_blank_line()
      auxbox_lm_mean_dmg()       -- mean:    XXX  dmg  YYY  dps
      auxbox_lm_sd_dmg()         -- sd  :    XXX  dmg  YYY  dps
      auxbox_lm_median_dmg()     -- med :    XXX  dmg  YYY  dps
      auxbox_lm_minmax_dmg()     -- min :    XXX  dmg  YYY  dps
                                 -- max :    XXX  dmg  YYY  dps
      auxbox_lm_last4dmg()       -- dmg :    XXX  XXX  XXX  XXX
      auxbox_blank_line()
      auxbox_lm_mean_hps()       -- mean:              XXX  hps
      auxbox_lm_sd_hps()         -- sd  :              XXX  hps
      auxbox_lm_median_hps()     -- med :              XXX  hps
      auxbox_lm_minmax_hps()     -- min :              XXX  hps
                                 -- max :              XXX  hps
      auxbox_lm_last4hps()       -- hps :    XXX  XXX  XXX  XXX
      auxbox_blank_line()
      auxbox_lm_mean_xp()        -- mean:    XXX   xp  YYY  xps
      auxbox_lm_sd_xp()          -- sd  :    XXX   xp  YYY  xps
      auxbox_lm_median_xp()      -- med :    XXX   xp  YYY  xps
      auxbox_lm_minmax_xp()      -- min :    XXX   xp  YYY  xps
                                 -- max :    XXX   xp  YYY  xps
      auxbox_lm_last4xp()        -- xp  :    XXX  XXX  XXX  XXX
      auxbox_blank_line()
      auxbox_lm_mean_kpm()       -- mean:              XXX  kpm
      auxbox_lm_sd_kpm()         -- sd  :              XXX  kpm
      auxbox_lm_median_kpm()     -- med :              XXX  kpm
      auxbox_lm_minmax_kpm()     -- min :              XXX  kpm
                                 -- max :              XXX  kpm
      auxbox_lm_last4kpm()       -- kpm :    XXX  XXX  XXX  XXX
    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


    old_build = {me:get_float_str(),
               me:get_float_dex(),
              me:get_float_intel(),
                 wl:get_full_name(me.weapon),
                 wl:get_full_name(me.shield),
              wl:get_full_name(me.armour),
              wl:get_full_name(me.boots),
              wl:get_full_name(me.gloves),
              wl:get_full_name(me.hat),
              wl:get_full_name(me.trousers),
              wl:get_full_name(me.ring1),
              wl:get_full_name(me.ring2),
              wl:get_full_name(me.amulet),
              wl:get_full_name(me.sigil1),
              wl:get_full_name(me.sigil2),
              wl:get_full_name(me.sigil3)}

    lm_last_dpst = g_dpst     
    lm_dmg_log = {}
    lm_dmgtime_log = {}
    lm_hit_count = 0
    lm_last_xp = me.xp
    lm_xp_log = {}
    lm_xptime_log = {}
    lm_kill_count = 0

    function auxbox_lm_dpscalc ()

     local new_build = {me:get_float_str(),
                        me:get_float_dex(),
                     me:get_float_intel(),
                        wl:get_full_name(me.weapon),
                        wl:get_full_name(me.shield),
                     wl:get_full_name(me.armour),
                     wl:get_full_name(me.boots),
                     wl:get_full_name(me.gloves),
                     wl:get_full_name(me.hat),
                     wl:get_full_name(me.trousers),
                     wl:get_full_name(me.ring1),
                     wl:get_full_name(me.ring2),
                     wl:get_full_name(me.amulet),
                     wl:get_full_name(me.sigil1),
                     wl:get_full_name(me.sigil2),
                     wl:get_full_name(me.sigil3)}
       
        for i=1,#old_build do
            if old_build[i] ~= new_build[i] then
           
           table.remove (old_build, i)
             table.insert (old_build, i, new_build[i])
              for i,v in pairs(lm_dmg_log) do
                 lm_dmg_log[i]=nil
               end
                for i,v in pairs(lm_dmgtime_log) do
                 lm_dmgtime_log[i]=nil
               end
             for i,v in pairs(lm_xp_log) do
                 lm_dmg_log[i]=nil
               end
                for i,v in pairs(lm_xptime_log) do
                 lm_dmgtime_log[i]=nil
               end
           lm_hit_count = 0
           lm_kill_count = 0
          end
        end

       if lm_hit_count == 0 then
         lm_hunt_start = os.clock()
        lm_last_killtime = os.clock()
        lm_dmg_start = g_dpst
        lm_xp_start = me.xp
       end
     lm_hunt_time = os.clock() - lm_hunt_start
     lm_total_dmg = g_dpst - lm_dmg_start
     lm_xp_gained = me.xp - lm_xp_start
       
       local lm_dmgtime_dif
       local lm_dmg_dif
       if lm_last_dpst ~= g_dpst then
           if lm_hit_count >= 1 then
              lm_dmgtime_dif = os.clock() - lm_last_hittime
             lm_dmg_dif = g_dpst - lm_last_dpst       
           
           --if lm_dmgtime_dif > (me:get_weapon_delay() / 1000) * 0.5 then
                  if lm_dmgtime_dif < (me:get_weapon_delay() / 1000) * 1.5 then
                   table.insert(lm_dmgtime_log, 1, lm_dmgtime_dif)
                 table.insert(lm_dmg_log, 1, lm_dmg_dif)
                   end
               --end
            end
        lm_last_hittime = os.clock()
        lm_last_dpst = g_dpst
        lm_hit_count = lm_hit_count + 1
       end
       
       local lm_xptime_dif
       local lm_xp_dif
       if lm_last_xp ~= me.xp and lm_hit_count >= 1 then
         lm_kill_count = lm_kill_count + 1
       
        lm_xptime_dif = os.clock() - lm_last_killtime
        table.insert(lm_xptime_log, 1, lm_xptime_dif)
        lm_last_killtime = os.clock()
       
        lm_xp_dif = me.xp - lm_last_xp
        table.insert(lm_xp_log, 1, lm_xp_dif)
        lm_last_xp = me.xp   
        end   
     
     local temp_lm_dmgtime_log={} -- for median time
     local lm_dmgtime_count = 0
      lm_max_hps = -math.huge -- for max time
      lm_min_hps = math.huge -- for min time
      lm_dmgtime_sum = 0
     
        if lm_dmgtime_log[1] ~= nil then
            for i,v in pairs(lm_dmgtime_log) do
                if type(v) == 'number' then
                 lm_dmgtime_sum = lm_dmgtime_sum + v
                 lm_dmgtime_count = lm_dmgtime_count + 1
              table.insert(temp_lm_dmgtime_log, v) -- for median time
              lm_min_hps = 1 / (math.max(lm_max_hps, v))
                 lm_max_hps = 1 / (math.min(lm_min_hps, v))
                   if lm_dmgtime_count >= 500 then
                  table.remove(lm_dmgtime_log, 500)
                     end
                end
            end
         lm_mean_hps = 1 / ((lm_dmgtime_sum / lm_dmgtime_count))
         else
         lm_mean_hps = 0
        lm_max_hps = 0
        lm_min_hps = 0
        end
       
     -- standard deviation time
     local dmgtime_vm
     local lm_dmgtime_sum_sd = 0
     local lm_dmgtime_count_sd = 0
        if lm_dmgtime_log[2] ~= nil then
            for i,v in pairs(lm_dmgtime_log) do
                if type(v) == 'number' then
                 dmgtime_vm = v - lm_mean_hps
                 lm_dmgtime_sum_sd = lm_dmgtime_sum_sd + (dmgtime_vm * dmgtime_vm)
                 lm_dmgtime_count_sd = lm_dmgtime_count_sd + 1
                end
            end
        lm_sd_hps = 1 / (math.sqrt(lm_dmgtime_sum_sd / (lm_dmgtime_count_sd-1)))
       else
        lm_sd_hps = 0
     end
     
     -- median time
        if temp_lm_dmgtime_log[50] ~= nil then
         table.sort(temp_lm_dmgtime_log)
         asterisk = " "
         -- If we have an even number of table elements or odd.
            if math.fmod(#temp_lm_dmgtime_log,2) == 0 then
             -- return mean value of middle two elements
             lm_median_hps = 1 / ((temp_lm_dmgtime_log[#temp_lm_dmgtime_log/2] + temp_lm_dmgtime_log[(#temp_lm_dmgtime_log/2)+1]) / 2)
             else
             -- return middle element
             lm_median_hps = 1 / (temp_lm_dmgtime_log[math.ceil(#temp_lm_dmgtime_log/2)])
            end
         else
            if wl:is_weapon(me.shield)==true then
            lm_median_hps = 1 / ((me:get_weapon_delay()/1000)) * 1.6
          else
             lm_median_hps = 1 / (me:get_weapon_delay()/1000)
          end
        asterisk = "!"
        end
       
     -- mean/max/min damage
     local temp_lm_dmg_log={} -- for median dmg
      lm_dmg_sum = 0
      lm_dmg_count = 0
      lm_max_dmg = -math.huge -- for max dmg
      lm_min_dmg = math.huge -- for min dmg
     
        if lm_dmg_log[1] ~= nil then
            for i,v in pairs(lm_dmg_log) do
                if type(v) == 'number' then
                 lm_dmg_sum = lm_dmg_sum + v
                 lm_dmg_count = lm_dmg_count + 1
              table.insert(temp_lm_dmg_log, v) -- for median dmg
              lm_max_dmg = math.max(lm_max_dmg, v)
                 lm_min_dmg = math.min(lm_min_dmg, v)
                   if lm_dmg_count >= 500 then
                  table.remove(lm_dmg_log, 500)
                     end
                end
            end
         lm_mean_dmg = (lm_dmg_sum / lm_dmg_count)
        else
         lm_mean_dmg = 0
        lm_max_dmg = 0
        lm_min_dmg = 0
        end
       
     -- mean dps
     lm_mean_dps = lm_mean_dmg * lm_median_hps
     
     -- standard deviation damage
     local vm
     local sum_sd = 0
     local count_sd = 0
        if lm_dmg_log[2] ~= nil then
            for i,v in pairs(lm_dmg_log) do
                if type(v) == 'number' then
                 vm = v - lm_mean_dmg
                 sum_sd = sum_sd + (vm * vm)
                 count_sd = count_sd + 1
                end
            end
         lm_sd_dmg = math.sqrt(sum_sd / (count_sd-1))
         else
        lm_sd_dmg = 0
       end

     -- standard deviation dps
     lm_sd_dps = lm_sd_dmg * lm_median_hps
     
     -- median damage
        if temp_lm_dmg_log[1] ~= nil then
         table.sort(temp_lm_dmg_log)

         -- If we have an even number of table elements or odd.
            if math.fmod(#temp_lm_dmg_log,2) == 0 then
             -- return mean value of middle two elements
             lm_median_dmg = ( temp_lm_dmg_log[#temp_lm_dmg_log/2] + temp_lm_dmg_log[(#temp_lm_dmg_log/2)+1] ) / 2
             else
             -- return middle element
             lm_median_dmg = temp_lm_dmg_log[math.ceil(#temp_lm_dmg_log/2)]
            end
         else
         lm_median_dmg = 0
        end
     
     -- median dps
     lm_median_dps = lm_median_dmg * lm_median_hps
     
     -- min dps
     lm_min_dps = lm_min_dmg * lm_median_hps
     
     -- max dps
     lm_max_dps = lm_max_dmg * lm_median_hps
    --------------------------------------------------------------------------------

     local temp_lm_xptime_log={} -- for median time
     local lm_xptime_count = 0
      lm_max_kpm = -math.huge -- for max time
      lm_min_kpm = math.huge -- for min time
      lm_xptime_sum = 0
     
        if lm_xptime_log[1] ~= nil then
            for i,v in pairs(lm_xptime_log) do
                if type(v) == 'number' then
                 lm_xptime_sum = lm_xptime_sum + v
                 lm_xptime_count = lm_xptime_count + 1
              table.insert(temp_lm_xptime_log, v) -- for median time
              lm_min_kpm = 1 / (math.max(lm_max_kpm, v))
                 lm_max_kpm = 1 / (math.min(lm_min_kpm, v))
                   if lm_xptime_count >= 500 then
                  table.remove(lm_xptime_log, 500)
                     end
                end
            end
         lm_mean_kpm = (1 / ((lm_xptime_sum / lm_xptime_count))) * 60
         else
         lm_mean_kpm = 0
        lm_max_kpm = 0
        lm_min_kpm = 0
        end
       
     -- standard deviation time
     local xptime_vm
     local lm_xptime_sum_sd = 0
     local lm_xptime_count_sd = 0
        if lm_xptime_log[2] ~= nil then
            for i,v in pairs(lm_xptime_log) do
                if type(v) == 'number' then
                 xptime_vm = v - lm_mean_kpm
                 lm_xptime_sum_sd = lm_xptime_sum_sd + (xptime_vm * xptime_vm)
                 lm_xptime_count_sd = lm_xptime_count_sd + 1
                end
            end
        lm_sd_kpm = (1 / (math.sqrt(lm_xptime_sum_sd / (lm_xptime_count_sd-1)))) * 60
       else
        lm_sd_kpm = 0
     end
     
     -- median time
        if temp_lm_xptime_log[2] ~= nil then
         table.sort(temp_lm_xptime_log)
         -- If we have an even number of table elements or odd.
            if math.fmod(#temp_lm_xptime_log,2) == 0 then
             -- return mean value of middle two elements
             lm_median_kpm = (1 / ((temp_lm_xptime_log[#temp_lm_xptime_log/2] + temp_lm_xptime_log[(#temp_lm_xptime_log/2)+1]) / 2)) * 60
             else
             -- return middle element
             lm_median_kpm = (1 / (temp_lm_xptime_log[math.ceil(#temp_lm_xptime_log/2)])) * 60
            end
         else
        lm_median_kpm = 0
       end
       
     -- mean/max/min xp
     local temp_lm_xp_log={} -- for median xp
      lm_xp_sum = 0
      lm_xp_count = 0
      lm_max_xp = -math.huge -- for max xp
      lm_min_xp = math.huge -- for min xp
     
        if lm_xp_log[1] ~= nil then
            for i,v in pairs(lm_xp_log) do
                if type(v) == 'number' then
                 lm_xp_sum = lm_xp_sum + v
                 lm_xp_count = lm_xp_count + 1
              table.insert(temp_lm_xp_log, v) -- for median xp
              lm_max_xp = math.max(lm_max_xp, v)
                 lm_min_xp = math.min(lm_min_xp, v)
                   if lm_xp_count >= 500 then
                  table.remove(lm_xp_log, 500)
                     end
                end
            end
         lm_mean_xp = (lm_xp_sum / lm_xp_count)
        else
         lm_mean_xp = 0
        lm_max_xp = 0
        lm_min_xp = 0
        end
       
     -- mean, min, max kpm
     lm_mean_xps = lm_mean_xp * (lm_median_kpm / 60)
     lm_min_xps = lm_min_xp * (lm_median_kpm / 60)
     lm_max_xps = lm_max_xp * (lm_median_kpm / 60)
     
     -- standard deviation xp
     local xpvm
     local xpsum_sd = 0
     local xpcount_sd = 0
        if lm_xp_log[2] ~= nil then
            for i,v in pairs(lm_xp_log) do
                if type(v) == 'number' then
                 xpvm = v - lm_mean_xp
                 xpsum_sd = xpsum_sd + (xpvm * xpvm)
                 xpcount_sd = xpcount_sd + 1
                end
            end
         lm_sd_xp = math.sqrt(xpsum_sd / (xpcount_sd-1))
         else
        lm_sd_xp = 0
       end

     -- standard deviation kpm
     lm_sd_xps = lm_sd_xp * (lm_median_kpm / 60)
     
     -- median xp
        if temp_lm_xp_log[1] ~= nil then
         table.sort(temp_lm_xp_log)

         -- If we have an even number of table elements or odd.
            if math.fmod(#temp_lm_xp_log,2) == 0 then
             -- return mean value of middle two elements
             lm_median_xp = ( temp_lm_xp_log[#temp_lm_xp_log/2] + temp_lm_xp_log[(#temp_lm_xp_log/2)+1] ) / 2
             else
             -- return middle element
             lm_median_xp = temp_lm_xp_log[math.ceil(#temp_lm_xp_log/2)]
            end
         else
         lm_median_xp = 0
        end
     
     -- median kpm
     lm_median_xps = lm_median_xp * (lm_median_kpm / 60)
           
    end

    function auxbox_lm_hits()
     auxbox_prop_line("Total Hits  :", string.format("%d",lm_hit_count))
    end

    function auxbox_lm_time()
     h = math.floor(lm_hunt_time / 60 / 60)
     m = math.floor((lm_hunt_time / 60 / 60 - h) * 60)
     s = math.floor(((lm_hunt_time / 60 / 60 - h) * 60 - m) * 60)
     --ms = ((((lm_hunt_time / 60 / 60 - h) * 60 - m) * 60) - s) * 1000
     auxbox_prop_line("Total Time  :", string.format("%02.f:%02.f:%02.f", h, m, s))
    end

    function auxbox_lm_dmg()
     auxbox_prop_line("Total Dmg   :", string.format("%d",lm_total_dmg))
    end

    function auxbox_lm_dps()
     auxbox_prop_line("Total Dps   :", string.format("%d",lm_total_dmg/lm_hunt_time))
    end

    function auxbox_lm_mean_dmg()
     auxbox_prop_line("Mean :", string.format("%4.f  dmg %4.f%s dps", lm_mean_dmg, lm_mean_dps, asterisk))
    end

    function auxbox_lm_sd_dmg()
     auxbox_prop_line("Sd   :", string.format("%4.f  dmg %4.f%s dps", lm_sd_dmg, lm_sd_dps, asterisk))
    end

    function auxbox_lm_median_dmg()
     auxbox_prop_line("Med  :", string.format("%4.f  dmg %4.f%s dps", lm_median_dmg, lm_median_dps, asterisk))
    end

    function auxbox_lm_minmax_dmg()
     auxbox_prop_line("Min  :", string.format("%4.f  dmg %4.f%s dps", lm_min_dmg, lm_min_dps, asterisk))
     auxbox_prop_line("Max  :", string.format("%4.f  dmg %4.f%s dps", lm_max_dmg, lm_max_dps, asterisk))
    end

    function auxbox_lm_last4dmg()
     local hit1, hit2, hit3, hit4
     if lm_dmg_log[1] ~= nill then hit1 = lm_dmg_log[1] else hit1 = 0 end
     if lm_dmg_log[2] ~= nill then hit2 = lm_dmg_log[2] else hit2 = 0 end
     if lm_dmg_log[3] ~= nill then hit3 = lm_dmg_log[3] else hit3 = 0 end
     if lm_dmg_log[4] ~= nill then hit4 = lm_dmg_log[4] else hit4 = 0 end
     auxbox_prop_line("dmg  :", string.format("%4.f %4.f %4.f %4.f", hit4, hit3, hit2, hit1))
    end

    function auxbox_lm_mean_hps()
     auxbox_prop_line("Mean :", string.format("%.2f  hps", lm_mean_hps))
    end

    function auxbox_lm_sd_hps()
     auxbox_prop_line("Sd   :", string.format("%.2f  hps", lm_sd_hps))
    end

    function auxbox_lm_median_hps()
     auxbox_prop_line("Med  :", string.format("%.2f%s hps", lm_median_hps, asterisk))
    end

    function auxbox_lm_minmax_hps()
     auxbox_prop_line("Min  :", string.format("%4.2f  hps", lm_min_hps))
     auxbox_prop_line("Max  :", string.format("%4.2f  hps", lm_max_hps))
    end

    function auxbox_lm_last4hps()
     local hit1, hit2, hit3, hit4
     if lm_dmgtime_log[1] ~= nill then hit1 = 1 / lm_dmgtime_log[1] else hit1 = 0 end
     if lm_dmgtime_log[2] ~= nill then hit2 = 1 / lm_dmgtime_log[2] else hit2 = 0 end
     if lm_dmgtime_log[3] ~= nill then hit3 = 1 / lm_dmgtime_log[3] else hit3 = 0 end
     if lm_dmgtime_log[4] ~= nill then hit4 = 1 / lm_dmgtime_log[4] else hit4 = 0 end
     auxbox_prop_line("hps  :", string.format("%4.2f %4.2f %4.2f %4.2f", hit4, hit3, hit2, hit1))
    end

    function auxbox_lm_kills()
     auxbox_prop_line("Total Kills :", string.format("%d", lm_kill_count))
    end

    function auxbox_lm_xp_gained()
     auxbox_prop_line("Total XP    :", string.format("%d", lm_xp_gained))
    end

    function auxbox_lm_xpps()
     auxbox_prop_line("Total XP/s  :", string.format("%d", lm_xp_gained / lm_hunt_time))
    end

    function auxbox_lm_xppm()
     auxbox_prop_line("Total XP/min:", string.format("%d", lm_xp_gained / lm_hunt_time * 60))
    end

    function auxbox_lm_mean_xp()
     auxbox_prop_line("Mean :", string.format("%4.f   xp %4.f  xps", lm_mean_xp, lm_mean_xps))
    end

    function auxbox_lm_sd_xp()
     auxbox_prop_line("Sd   :", string.format("%4.f   xp %4.f  xps", lm_sd_xp, lm_sd_xps))
    end

    function auxbox_lm_median_xp()
     auxbox_prop_line("Med  :", string.format("%4.f   xp %4.f  xps", lm_median_xp, lm_median_xps))
    end

    function auxbox_lm_minmax_xp()
     auxbox_prop_line("Min  :", string.format("%4.f   xp %4.f  xps", lm_min_xp, lm_min_xps))
     auxbox_prop_line("Max  :", string.format("%4.f   xp %4.f  xps", lm_max_xp, lm_max_xps))
    end

    function auxbox_lm_last4xp()
     local kill1, kill2, kill3, kill4
     if lm_xp_log[1] ~= nill then kill1 = lm_xp_log[1] else kill1 = 0 end
     if lm_xp_log[2] ~= nill then kill2 = lm_xp_log[2] else kill2 = 0 end
     if lm_xp_log[3] ~= nill then kill3 = lm_xp_log[3] else kill3 = 0 end
     if lm_xp_log[4] ~= nill then kill4 = lm_xp_log[4] else kill4 = 0 end
     auxbox_prop_line("xp   :", string.format("%4.f %4.f %4.f %4.f", kill4, kill3, kill2, kill1))
    end

    function auxbox_lm_mean_kpm()
     auxbox_prop_line("Mean :", string.format("%d  kpm", lm_mean_kpm))
    end

    function auxbox_lm_sd_kpm()
     auxbox_prop_line("Sd   :", string.format("%d  kpm", lm_sd_kpm))
    end

    function auxbox_lm_median_kpm()
     auxbox_prop_line("Med  :", string.format("%d  kpm", lm_median_kpm))
    end

    function auxbox_lm_minmax_kpm()
     auxbox_prop_line("Min  :", string.format("%d  kpm", lm_min_kpm))
     auxbox_prop_line("Max  :", string.format("%d  kpm", lm_max_kpm))
    end

    function auxbox_lm_last4kpm()
     local kill1, hit2, hit3, hit4
     if lm_xptime_log[1] ~= nill then kill1 = 1 / lm_xptime_log[1] * 60 else kill1 = 0 end
     if lm_xptime_log[2] ~= nill then kill2 = 1 / lm_xptime_log[2] * 60 else kill2 = 0 end
     if lm_xptime_log[3] ~= nill then kill3 = 1 / lm_xptime_log[3] * 60 else kill3 = 0 end
     if lm_xptime_log[4] ~= nill then kill4 = 1 / lm_xptime_log[4] * 60 else kill4 = 0 end
     auxbox_prop_line("kpm  :", string.format("%4.0f %4.0f %4.0f %4.0f", kill4, kill3, kill2, kill1))
    end
You do not have the required permissions to view the files attached to this post.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[LordM] Instance Reset

Postby CIAassassin » Wed Jun 19, 2013 6:38 am

Code: Select all
    lm_instancemap_log = {}
    lm_instance_list = {
    [54] = "Mino Halls", [55] = "Mino Halls", [56] = "Mino Halls", [57] = "Mino Halls", [58] = "Mino Halls",
    [59] = "Mino Halls", [60] = "Mino Halls", [61] = "Mino Halls",
    [63] = "Mt. Pass", [64] = "Mt. Pass", [65] = "Mt. Pass", [66] = "Mt. Pass",
    [67] = "Pendragon", [68] = "Pendragon", [69] = "Pendragon", [70] = "Pendragon",
    [110] = "Wiz Tower", [111] = "Wiz Tower", [112] = "Wiz Tower", [113] = "Wiz Tower", [114] = "Wiz Tower",
    [115] = "Wiz Tower", [116] = "Wiz Tower", [117] = "Wiz Tower",
    [120] = "Tangled", [121] = "Tangled", [122] = "Tangled", [123] = "Tangled", [124] = "Tangled",
    [125] = "Tangled", [126] = "Tangled", [127] = "Tangled", [128] = "Tangled",
    [136] = "Cass Tower", [137] = "Cass Tower",
    [175] = "Rivers End", [176] = "Rivers End", [177] = "Rivers End", [178] = "Rivers End", [179] = "Rivers End",
    [180] = "Rivers End",
    [182] = "VotT", [183] = "VotT", [184] = "VotT", [185] = "VotT", [186] = "VotT",
    [196] = "CoS",
    [230] = "Anathema", [231] = "Anathema", [232] = "Anathema", [233] = "Anathema", [234] = "Anathema",
    [235] = "Anathema", [236] = "Anathema",
    [282] = "Blood Moor"
    }

    function auxbox_lm_dynamic_instance_reset()
         
       if cmap:get_level() ~= me.map_level and cmap:get_level() >= 0 then
            if lm_instance_list[cmap:get_level()] ~= nil then
            lm_parentmap = lm_instance_list[cmap:get_level()]
            else lm_parentmap = cmap:get_level()
          end
        lm_tempmap = me.map_level
        lm_instance_visited = 1
        lm_instance_exit = os.time()
       end
       
       if cmap:get_level() == me.map_level and lm_instance_visited == 1 then
        lm_instance_visited = 0
       
        lm_instancemap_log[lm_parentmap] = lm_instance_exit
       end
       
       local lm_instance_reset = 0
       for i, v in pairs(lm_instancemap_log) do
        lm_instance_reset = 600 - (os.time() - v)
         
        local m = math.floor(lm_instance_reset / 60)
         local s = math.floor((lm_instance_reset / 60 - m) * 60)
     
         auxbox_prop_line(string.format("%s resets in",i),string.format("%02.f:%02.f", m, s))     
       
           if lm_instance_reset <= 0 then
            lm_instancemap_log[i] = nil
            end
       end
    end
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

[Mud] Selected Item Export

Postby CIAassassin » Sun Sep 22, 2013 10:52 pm

Code: Select all
    local out_f = assert(io.open("seen_items.txt", "w"))
    local curr_item = nil

    function auxbox()
        if not d:ok_to_draw_play_window() then
            return
        end
        local new_item = get_highlighted_item()
        if new_item ~= curr_item then
            if wl:is_legit(new_item) and wl:get_type(new_item) ~= ITEM_NOTHING then
                local quant = items:get_qty(new_item)
                local quant_s = ""
                if quant >= 1 then
                    quant_s = string.format(" x%d", quant)
                end
                out_f:write(wl:get_full_name(new_item) .. quant_s .. "\n")
                out_f:flush()
            end
            curr_item = new_item
        end
    end
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

Re: Completed Auxbox Codes

Postby Keighn » Sat Dec 14, 2013 7:39 am

Bump cause I couldn't find this bugger. :mad:
ZUPS!!!!
User avatar
Keighn
Stop posting already --;
 
Posts: 5241
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: Completed Auxbox Codes

Postby Keighn » Sat Dec 14, 2013 7:58 am

I want to have the last 5 hits done to me added but forgot how to do it. here's what I have from someone that sent me shiz

auxbox_next_line = 0
session_time = 0
sessionstart = os.time()
function auxbox()
d:auxbox_clear();
auxbox_next_line = 0
auxbox_real_world_time()
auxbox_blank_line()
auxbox_xp()
auxbox_last_few()
auxbox_blank_line()
Items_Left()
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

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("XP to Level:",

string.format("%d", xptolvl))
--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))
end
end


last_session_seconds = 0
last_5_dpst = { g_dpst, g_dpst, g_dpst, g_dpst }
last_5_dtpst = { g_dtpst, g_dtpst, g_dtpst,

g_dtpst }
last_dpst = g_dpst
last_dtpst = g_dtpst
recent_dmg = { 0, 0, 0, 0, }
recent_dmgt = { 0, 0, 0, 0, }
function auxbox_last_few()
local session_seconds = os.time() -

sessionstart

if session_seconds > last_session_seconds then
last_session_seconds = session_seconds
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[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[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
if last_dtpst ~= g_dtpst then
table.remove(recent_dmgt, 4)
table.insert(recent_dmgt, 1, g_dtpst -

last_dtpst)
last_dtpst = g_dtpst
end
auxbox_prop_line("Last Few Hits:", "")
auxbox_prop_line(string.format("%d %d

%d %d",recent_dmg[4], recent_dmg[3],

recent_dmg[2], recent_dmg[1]))
auxbox_prop_line(cent_dmg[3] = recent_dmg[2]
recent_dmg[2] = recent_dmg[1]
recent_dmg[1] = g_dpst - last_dpst
last_dpst = g_dpst
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))

function Items_Left()
auxbox_prop_line("Items Left")
auxbox_prop_line("Mega Yellow:",

items:get_qty_basecode(363))
auxbox_prop_line("Other Yellow Potions:",

items:get_qty_basecode(260))
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("Brown Potions:",

items:get_qty_basecode(358))
--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("Omelettes:",

items:get_qty_basecode(1380))
auxbox_prop_line("Dragon Rations:",

items:get_qty_basecode(1399))
--auxbox_prop_line("Greater Health:",

items:get_qty_basecode(12))
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("Sanct Lor:",

items:get_qty(make_code(286,0,0,18)))
auxbox_prop_line("Black Potions:",

items:get_qty_basecode(352))
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("Bandages:",

items:get_qty_basecode(375))
auxbox_prop_line("Arrows:",

items:get_qty_basecode(296))
auxbox_prop_line("Bullets:",

items:get_qty_basecode(1294))
auxbox_prop_line("Soul Shards:",

items:get_qty_basecode(1283))
end
end


someone please amend and post... maybe suggest something else in there.. theree's a ton of room
User avatar
Keighn
Stop posting already --;
 
Posts: 5241
Joined: Sat Jun 26, 2004 10:13 am
Location: Hey.... pssttt Back in Orgeon

Re: Completed Auxbox Codes

Postby CIAassassin » Sat Dec 14, 2013 9:59 am

wrong thread holmes. You need to head over to the other thread to get those. I don't think anyone follows this one.
Rikimaru

"Oh, you're a lesbian? That's cool, I'm a lesbian trapped in a mans body, we should date."
User avatar
CIAassassin
Tune in next time & see how they do it.
 
Posts: 599
Joined: Thu Oct 26, 2006 10:34 am

Next

Return to Auxbox repository

Who is online

Users browsing this forum: No registered users and 1 guest