Results 1 to 9 of 9

Thread: Hud ibot loot counter

  1. #1
    iBot User
    Join Date
    Apr 2012
    Posts
    35
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5

    Hud ibot loot counter

    the hud Ibot Loot Counter, are not counting the waste of prismatic bolt, someone can help me?

  2. #2
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by ducky123 View Post
    the hud Ibot Loot Counter, are not counting the waste of prismatic bolt, someone can help me?
    Normal ibot or ibot+?

  3. #3
    iBot User
    Join Date
    Apr 2012
    Posts
    35
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by Drakke View Post
    Normal ibot or ibot+?
    normal ibot

  4. #4
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by ducky123 View Post
    normal ibot
    THen make sure your bolt of choice is in the HUDs code, else it will not count it

  5. #5
    iBot User
    Join Date
    Apr 2012
    Posts
    35
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by Drakke View Post
    THen make sure your bolt of choice is in the HUDs code, else it will not count it
    yep, its ok, but not work

  6. #6
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    Quote Originally Posted by ducky123 View Post
    yep, its ok, but not work
    You sure you have the correct hud for arrows?

  7. #7
    iBot User
    Join Date
    Apr 2012
    Posts
    35
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    Quote Originally Posted by Drakke View Post
    You sure you have the correct hud for arrows?
    --[[
    Name: iBot Loot Counter HUD
    Version: v1.0.0
    Last Updated: 21 Jan 2014
    ]]--


    HUD = {

    TITLE = "iBot Loot Counter",

    CONFIG = {
    ORIENTATION = "right",
    START_POSITION = {35, 25},
    MAX_TEXT_LENGTH = 15,
    TEXT_DISTANCE = 115,
    LINE_DISTANCE = 12,
    },

    ITEMS =
    {
    LOOT = getlootitems(),

    SUPPLY =
    {
    {NAME = "mana potion", VALUE = 50},
    {NAME = "strong mana potion", VALUE = 80},
    {NAME = "great mana potion", VALUE = 120},
    {NAME = "health potion", VALUE = 45},
    {NAME = "strong health potion", VALUE = 100},
    {NAME = "great health potion", VALUE = 190},
    {NAME = "ultimate health potion", VALUE = 310},
    {NAME = "Assassin Star", VALUE = 100},
    {NAME = "prismatic bolt", VALUE = 20},
    {NAME = "crystalline arrow", VALUE = 20},
    {NAME = "great fireball rune", VALUE = 45},
    {NAME = "sudden death rune", VALUE = 108},
    {NAME = "avalanche rune", VALUE = 45},
    {NAME = "icicle rune", VALUE = 30},
    {NAME = "fireball rune", VALUE = 30},
    {NAME = "thunderstorm rune", VALUE = 37},
    {NAME = "Soft Boots", VALUE = 10000},
    {NAME = "Rust Remover", VALUE = 50}
    }
    },

    --[[ Just edit below if you know what you're doing --]]

    COLORS = {
    SHADOW = rgbcolor(10, 10, 10),
    TITLE = rgbcolor(255, 165, 0),
    TEXT1 = rgbcolor(205, 200, 177),
    TEXT2 = rgbcolor(255, 255, 255),
    SUBTITLE = rgbcolor(30, 144, 255),
    PROFIT = rgbcolor(107, 142, 35),
    WASTE = rgbcolor(178, 34, 34),
    },

    VERSION = "1.0"
    }

    --[[ DONT EDIT NOTHING BELOW THIS LINE --]]

    function formatnumber(n, s)
    local result, sign, before, after = '', string.match(tostring(n), '^([%+%-]?)(%d*)(%.?.*)$')

    while #before > 3 do
    result = (s or '.') .. string.sub(before, -3, -1) .. result
    before = string.sub(before, 1, -4)
    end

    return sign .. before .. result .. after
    end

    local X, Y, INDEX, TOTAL, TOTAL_LOOTED, TOTAL_WASTED = (HUD.CONFIG.ORIENTATION:lower() == "right" and worldwin.right + 10 or clientwin.left + 10) + HUD.CONFIG.START_POSITION[1], worldwin.top + 10 + HUD.CONFIG.START_POSITION[2], 1, 0, 0, 0

    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke(HUD.TITLE, X, Y)

    Y = Y + 20

    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("ITEMS LOOTED:", X, Y)

    Y = Y + 5

    local lootqtd = HUD.ITEMS.LOOT.count-1

    for it = 0, lootqtd do
    local ITEM = HUD.ITEMS.LOOT[it]
    if ITEM.lootmessage > 0 then
    Y = Y + HUD.CONFIG.LINE_DISTANCE

    local itemvalue = ITEM.npcsell
    if ITEM.custom ~= 0 then
    itemvalue = ITEM.custom
    end

    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)

    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke(string.format("%s (%s k)", formatnumber(ITEM.lootmessage), math.floor(ITEM.lootmessage * itemvalue / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)

    TOTAL, TOTAL_LOOTED = TOTAL + ITEM.lootmessage * itemvalue, TOTAL_LOOTED + (ITEM.lootmessage * itemvalue)
    end
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2

    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke("Total: ", X, Y)

    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke(formatnumber(TOTAL_LOOTED) .. " GPs", X+35, Y)

    Y = Y + 25

    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("SUPPLIES USED:", X, Y)

    Y = Y + 5

    for _, ITEM in ipairs(HUD.ITEMS.SUPPLY) do
    local ITEM_USED = itemproperty(ITEM.NAME)
    if ITEM_USED.usagemessage > 0 then
    Y = Y + HUD.CONFIG.LINE_DISTANCE

    setfontcolor(HUD.COLORS.TEXT1)
    addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)

    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke(string.format("%s (%sk)", formatnumber(ITEM_USED.usagemessage), math.floor(ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)) / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)

    TOTAL, TOTAL_WASTED = TOTAL - ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)), TOTAL_WASTED + (ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)))
    end
    end

    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2

    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke("Total: ", X, Y)

    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke("-" .. formatnumber(TOTAL_WASTED) .. " GPs", X + 35, Y)

    Y = Y + 25

    setfontcolor(TOTAL_LOOTED - TOTAL_WASTED >= 0 and HUD.COLORS.PROFIT or HUD.COLORS.WASTE)
    addtextstroke(string.format("%s %s GPs (%s k/h)", TOTAL_LOOTED - TOTAL_WASTED >= 0 and "PROFIT:" or "WASTE:", formatnumber(TOTAL_LOOTED - TOTAL_WASTED), math.floor(((TOTAL_LOOTED - TOTAL_WASTED) / (tosec(timehunt) / 3600)) / 100) / 10), X, Y)

  8. #8
    Moderator Drakke's Avatar
    Join Date
    Jun 2012
    Location
    Sweden
    Posts
    1,898
    Mentioned
    216 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    390 Post(s)
    Reputation
    366
    Rep Power
    10
    @ducky123

    Lua Code:
     
    HUD = {
     
        TITLE = "DRAKKE'S SCRIPT",
     
        CONFIG = {
            ORIENTATION = "left",
            START_POSITION = {35, 25},
            MAX_TEXT_LENGTH = 15,
            TEXT_DISTANCE = 115,
            LINE_DISTANCE = 12,
        },
     
        ITEMS =
        {
            LOOT = getlootitems(),
     
            SUPPLY =
        {
                {NAME = "mana potion", VALUE = 50},
                {NAME = "strong mana potion", VALUE = 80},
                {NAME = "great mana potion", VALUE = 120},
                {NAME = "health potion", VALUE = 45},
                {NAME = "strong health potion", VALUE = 100},
                {NAME = "great health potion", VALUE = 190},
                {NAME = "ultimate health potion", VALUE = 310},
                {NAME = "Assassin Star", VALUE = 100},
                {NAME = "prismatic bolt", VALUE = 20},
                {NAME = "bolt", VALUE = 4},
                {NAME = "drill bolt", VALUE = 12},
                {NAME = "infernal bolt", VALUE = 15},
                {NAME = "piercing bolt", VALUE = 5},
                {NAME = "vortex bolt", VALUE = 6},
                {NAME = "power bolt", VALUE = 7},
                {NAME = "crystalline arrow", VALUE = 20},
                {NAME = "arrow", VALUE = 3},
                {NAME = "burst arrow", VALUE = 10},
                {NAME = "earth arrow", VALUE = 5},
                {NAME = "envenomed arrow", VALUE = 12},
                {NAME = "Flaming arrow", VALUE = 5},
                {NAME = "Flash arrow", VALUE = 5},
                {NAME = "Onyx arrow", VALUE = 7},
                {NAME = "Poison arrow", VALUE = 1},
                {NAME = "Shiver arrow", VALUE = 5},
                {NAME = "Sniper arrow", VALUE = 5},
                {NAME = "Tarsal arrow", VALUE = 6},
                {NAME = "great fireball rune", VALUE = 45},
                {NAME = "sudden death rune", VALUE = 108},
                {NAME = "avalanche rune", VALUE = 45},
                {NAME = "icicle rune", VALUE = 30},
                {NAME = "fireball rune", VALUE = 30},
                {NAME = "thunderstorm rune", VALUE = 37},
                {NAME = "Soft Boots", VALUE = 10000},
                {NAME = "Rust Remover", VALUE = 50}
            }
        },
     
        --[[ Just edit below if you know what you're doing --]]
     
        COLORS = {
        SHADOW = rgbcolor(0, 0, 0),
        TITLE = rgbcolor(205, 200, 177),
        TEXT1 = rgbcolor(205, 200, 177),
        TEXT2 = rgbcolor(255, 255, 255),
        SUBTITLE = rgbcolor(210, 20, 10),
        TOTALLOOT = rgbcolor(107, 142, 35),
        TOTALSUPS = rgbcolor(178, 34, 34),
        PROFIT = rgbcolor(107, 142, 35),
        WASTE = rgbcolor(178, 34, 34),
        },
     
        VERSION = "1.0"
    }
     
    --[[ DONT EDIT NOTHING BELOW THIS LINE --]]
     
    AMMO_COUNT, AMMO_COUNT_BP = AMMO_COUNT or 0, AMMO_COUNT_BP or 0
    local DISTANCE_WEAPONS, AMMUNITION, AMMO_NAME, AMMO_TYPE_COUNT, ADD_TO_HUD = {"assassin star", "enchanted spear", "hunting spear", "mean paladin spear", "royal spear", "small stone", "snowball", "spear", "throwing knife", "throwing star", "viper star"}, {"arrow", "burst arrow", "crystalline arrow", "earth arrow", "envenomed arrow", "flaming arrow", "flash arrow", "onyx arrow", "poison arrow", "shiver arrow", "sniper arrow", "tarsal arrow", "infernal bolt", "drill bolt", "power bolt", "prismatic bolt", "vortex bolt", "piercing bolt", "bolt"}, nil, 0, 0
     
    if (weapon ~= 0) and (table.find(DISTANCE_WEAPONS, itemname(weapon):lower())) then
        AMMO_NAME, AMMO_TYPE_COUNT = itemname(weapon) or nil, weaponamount or 0
    elseif (ammo ~= 0) and (table.find(AMMUNITION, itemname(ammo):lower())) then
        AMMO_NAME, AMMO_TYPE_COUNT = itemname(ammo) or nil, ammoamount or 0
    end
     
    if (AMMO_NAME ~= nil) then
        local CURRENT_AMMO_COUNT = itemcount(AMMO_NAME)
     
        if (AMMO_TYPE_COUNT < AMMO_COUNT) then
            ADD_TO_HUD = math.max(0, AMMO_COUNT-AMMO_TYPE_COUNT)
        elseif (AMMO_TYPE_COUNT > AMMO_COUNT) and (CURRENT_AMMO_COUNT < AMMO_COUNT_BP) then
            ADD_TO_HUD = math.max(0, (AMMO_COUNT+(AMMO_COUNT_BP-CURRENT_AMMO_COUNT))-100)
        end
     
        addhudsupplie(AMMO_NAME, ADD_TO_HUD)
        AMMO_COUNT, AMMO_COUNT_BP = AMMO_TYPE_COUNT, CURRENT_AMMO_COUNT
    end
     
    function formatnumber(n, s)
        local result, sign, before, after = '', string.match(tostring(n), '^([%+%-]?)(%d*)(%.?.*)$')
     
        while #before > 3 do
            result = (s or '.') .. string.sub(before, -3, -1) .. result
            before = string.sub(before, 1, -4)
        end
     
        return sign .. before .. result .. after
    end
     
    local X, Y, INDEX, TOTAL, TOTAL_LOOTED, TOTAL_WASTED = (HUD.CONFIG.ORIENTATION:lower() == "right" and worldwin.right + 10 or clientwin.left + 10) + HUD.CONFIG.START_POSITION[1], worldwin.top + 10 + HUD.CONFIG.START_POSITION[2], 1, 0, 0, 0
     
    setfontcolor(HUD.COLORS.TITLE)
    addtextstroke(HUD.TITLE, X, Y)
     
    Y = Y + 20
     
    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("ITEMS LOOTED:", X, Y)
     
    Y = Y + 5
     
    local lootqtd = HUD.ITEMS.LOOT.count-1
     
    for it = 0, lootqtd do
        local ITEM = HUD.ITEMS.LOOT[it]
        if ITEM.lootmessage > 0 then
            Y = Y + HUD.CONFIG.LINE_DISTANCE
     
        local itemvalue = ITEM.npcsell
        if ITEM.custom ~= 0 then
            itemvalue = ITEM.custom
        end
     
        setfontcolor(HUD.COLORS.TEXT1)
            addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)
     
        setfontcolor(HUD.COLORS.TEXT2)
        addtextstroke(string.format("%s (%s k)", formatnumber(ITEM.lootmessage), math.floor(ITEM.lootmessage * itemvalue / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)
     
            TOTAL, TOTAL_LOOTED = TOTAL + ITEM.lootmessage * itemvalue, TOTAL_LOOTED + (ITEM.lootmessage * itemvalue)
        end
    end
     
    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
     
    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke("Total: ", X, Y)
     
    setfontcolor(HUD.COLORS.PROFIT)
    addtextstroke('+' .. formatnumber(TOTAL_LOOTED) .. " GPs", X+35, Y)
     
    Y = Y + 25
     
    setfontcolor(HUD.COLORS.SUBTITLE)
    addtextstroke("SUPPLIES USED:", X, Y)
     
    Y = Y + 5
     
    for _, ITEM in ipairs(HUD.ITEMS.SUPPLY) do
        local ITEM_USED = itemproperty(ITEM.NAME)
        if ITEM_USED.usagemessage > 0 then
            Y = Y + HUD.CONFIG.LINE_DISTANCE
     
        setfontcolor(HUD.COLORS.TEXT1)
            addtextstroke((#ITEM.NAME < HUD.CONFIG.MAX_TEXT_LENGTH and ITEM.NAME or ITEM.NAME:sub(1, HUD.CONFIG.MAX_TEXT_LENGTH) .. "..."):gsub("(%a)([%w_']*)", function(s1, s2) return s1:upper() .. s2:lower() end), X, Y)
     
        setfontcolor(HUD.COLORS.TEXT2)
        addtextstroke(string.format("%s (%sk)", formatnumber(ITEM_USED.usagemessage), math.floor(ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)) / 100) / 10), X + HUD.CONFIG.TEXT_DISTANCE, Y)
     
            TOTAL, TOTAL_WASTED = TOTAL - ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)), TOTAL_WASTED + (ITEM_USED.usagemessage * (ITEM.VALUE or itemvalue(ITEM.NAME)))
        end
    end
     
    Y = Y + HUD.CONFIG.LINE_DISTANCE + 2
     
    setfontcolor(HUD.COLORS.TEXT2)
    addtextstroke("Total: ", X, Y)
     
    setfontcolor(HUD.COLORS.WASTE)
    addtextstroke("-" .. formatnumber(TOTAL_WASTED) .. " GPs", X + 35, Y)
     
    Y = Y + 25
     
    setfontcolor(TOTAL_LOOTED - TOTAL_WASTED >= 0 and HUD.COLORS.PROFIT or HUD.COLORS.WASTE)
    addtextstroke(string.format("%s %s GPs (%s k/h)", TOTAL_LOOTED - TOTAL_WASTED >= 0 and "PROFIT:" or "WASTE:", formatnumber(TOTAL_LOOTED - TOTAL_WASTED), math.floor(((TOTAL_LOOTED - TOTAL_WASTED) / (tosec(timehunt) / 3600)) / 100) / 10), X, Y)

  9. #9
    iBot User
    Join Date
    Apr 2012
    Posts
    35
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    3 Post(s)
    Reputation
    10
    Rep Power
    5
    thx brooooo

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •