Signup Now
Page 12 of 14 FirstFirst ... 21011121314 LastLast
Results 111 to 120 of 131

Thread: Kill Counter

  1. #111
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,437
    Reputation
    309
    Rep Power
    29
    Quote Originally Posted by XtreLu View Post
    Could you help me boys? i;m new user, and I wanna add auto hydras tasker to my script, but i dont know how use this auto counter, pls explain
    I'll try and get a video tutorial up soon.

  2. #112
    Free User
    Join Date
    Nov 2014
    Posts
    11
    Reputation
    10
    Rep Power
    0
    Thanks mate!

  3. #113
    Free User Nimo's Avatar
    Join Date
    Dec 2015
    Posts
    1,202
    Reputation
    120
    Rep Power
    21
    @Raphael
    I think killCount.set isn't working correctly. I tried to add few kinds of pirates (since they all count to one task), so I tried
    killCount.set(100, "Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")

    then I wanted to check how the count and it returned 300, instead of 100



    I would be very grateful if you check it out.

  4. #114
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,819
    Reputation
    220
    Rep Power
    27
    @Nimo, it's because it will assign 100 to each of them? So if you check 3 types of pirates it will show 3*100

  5. #115
    Free User Nimo's Avatar
    Join Date
    Dec 2015
    Posts
    1,202
    Reputation
    120
    Rep Power
    21
    Quote Originally Posted by mistgun View Post
    @Nimo, it's because it will assign 100 to each of them? So if you check 3 types of pirates it will show 3*100
    I was not sure if it's properly

  6. #116
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,437
    Reputation
    309
    Rep Power
    29
    Quote Originally Posted by Nimo View Post
    @Raphael
    I think killCount.set isn't working correctly. I tried to add few kinds of pirates (since they all count to one task), so I tried
    killCount.set(100, "Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")

    then I wanted to check how the count and it returned 300, instead of 100



    I would be very grateful if you check it out.
    Yes, that's exactly what Mistgun said. When you do
    killCount.set(100, "Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")
    you're saying that you've killed 100 of each pirate. When you do
    killCount.get("Pirate Cutthroat", "Pirate Corsair", "Pirate Buccaner")
    you're getting the sum of all three pirates. Because 100 + 100 + 100 = 300, this is the expected behavior.

    I'll concede, however, that this might seem weird but there isn't much that can be done now.

  7. #117
    Banned
    Join Date
    Jan 2015
    Location
    Cuiaba - MT
    Posts
    498
    Reputation
    21
    Rep Power
    0
    so if i hunt on quaras scount w/ tasker... to me edit how many i've killed i set
    Code:
    killCount.set(0, "Quara Hydromancer Scout")
    or i have to do 4 times it? one for each mobs on there?

  8. #118
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,437
    Reputation
    309
    Rep Power
    29
    Quote Originally Posted by gponce View Post
    so if i hunt on quaras scount w/ tasker... to me edit how many i've killed i set
    Code:
    killCount.set(0, "Quara Hydromancer Scout")
    or i have to do 4 times it? one for each mobs on there?
    The following snippets are equivalent:

    killCount.set(0, "Quara Hydromancer", "Quara Pincher", "Quara Constrictor", "Quara Mantassin")


    killCount.set(0, "Quara Hydromancer")
    killCount.set(0, "Quara Pincher")
    killCount.set(0, "Quara Constrictor")
    killCount.set(0, "Quara Mantassin")

  9. #119
    Free User
    Join Date
    May 2016
    Posts
    4
    Reputation
    10
    Rep Power
    0
    Hello,

    (Need to know): I use teamviewer to access my comp at home remotely, with my office comp/iphone.

    Been playing around with a script i currently use and its working so.
    Sometimes it misses to count hydras. For example: while i monitor the client it doesn't miss a count, like ever. But when i close down teamwiever from phone/officecomputer and start it 1-2h later it says like 175 hydras killed in HUD while quest log says 220..
    But i have a hotkey for this to edit the kills but just curious what the problem is, fixable or i have to live with it?

    I assume its counting it from server log? I have every status message checked in console.

    Have yet to try it at home without teamviewer to see if its the same problem then.

    here is the hud:

    init start
    -- local SCRIPT_VERSION = '1.1.1'
    local Config = {
    ShowAll = true,
    Monsters = {"hydra"},

    }

    -- If set to true, will save kill count to $chardb so that it is persisted
    -- throughout different sessions.


    local saveToDB = true


    -- DO NOT EDIT BELOW THIS LINE --

    -- We don't want to override the object because that'd delete all data in
    -- killCount.creatures
    if killCount == nil then
    killCount = {
    creatures = {},
    lastRan = $timems
    }

    killCount.set = function(count, ...)
    local names = table.each({...}, string.lower)

    for _, v in ipairs(names) do
    killCount.creatures[v] = count

    if killCount.saveToDB then
    $chardb:setvalue('killCount', v, count)
    end
    end
    end

    killCount.add = function(addAmount, ...)
    local names = table.each({...}, string.lower)

    for _, v in ipairs(names) do
    killCount.set(killCount.get(v) + addAmount, v)
    end
    end

    killCount.reset = function(...)
    killCount.set(0, ...)
    end

    killCount.get = function(...)
    local names = table.each({...}, string.lower)

    local count = 0
    for _, v in ipairs(names) do
    local cCount = killCount.creatures[v]

    if cCount == nil then
    cCount = 0
    killCount.set(cCount, v)
    end

    count = count + cCount
    end

    return count
    end

    if saveToDB then
    -- Thanks to @Lucas Terra for implementing database iterators for the
    -- sole purpose of making this script better. Lucas, you rock!
    foreach $chardb:sectionvalue v 'killCount' do
    killCount.set(v.value, v.name)
    end
    end
    end

    -- We only set saveToDB now because else it would cause unnecessary updates
    -- queried to the database when we first read it.
    killCount.saveToDB = saveToDB


    auto(100)
    foreach newmessage m do
    if m.type == MSG_INFO then
    local creature = m.content:match(REGEX_LOOT)

    if creature then
    killCount.add(1, creature)
    end
    end
    end

    -- You're welcome, Leonardo
    killCount.lastRan = $timems

    local HUD = {
    Restart = -1,
    Start = 1,
    End = Config.MaxLines,
    strStart = 1,
    strEnd = 60,
    strMax = 60,
    Position = {$clientwin.left, $worldwin.bottom - ((#Config.Monsters + 1) * 14)},
    Auxiliar = {0, 0},
    ColumnWidth = {0, 0},
    Moving = false,
    Blue = {0.0, color(36, 68, 105, 20), 0.23, color(39, 73, 114, 20), 0.76, color(21, 39, 60, 20)},
    Black = {0.0, color(75, 75, 75, 20), 0.23, color(45, 45, 45, 20), 0.76, color(19, 19, 19, 20)},
    Orange = {0.0, color(145, 95, 0, 20), 0.23, color(158, 104, 0, 20), 0.76, color(84, 55, 0, 20)},
    Green = {0.0, color(65, 96, 12, 20), 0.23, color(67, 99, 13, 20), 0.76, color(36, 52, 6, 20)},
    Red = {0.0, color(90, 12, 15, 20), 0.23, color(98, 13, 17, 20), 0.76, color(52, 6, 9, 20)},
    }

    local tempPos = $chardb:getvalue('AWE.TH', 'POSITION')

    if tempPos then
    tempPos = tempPos:explode(":")
    HUD.Position = {tonumber(tempPos[1]), tonumber(tempPos[2])}
    end

    filterinput(false, true, false, false) setfontstyle('Tahoma', 8, 75) setfillstyle('gradient', 'linear', 2, 0, 0, 0, 14) setfontstyle('Tahoma', 8, 50, 0xFFFFFF, 1, color(0, 0, 0, 50))

    function inputevents(e)
    if e.type == IEVENT_RMOUSEDOWN or e.type == IEVENT_MMOUSEDOWN then
    HUD.Moving, HUD.Auxiliar = true, {$cursor.x - HUD.Position[1], $cursor.y - HUD.Position[2]}
    elseif e.type == IEVENT_RMOUSEUP or e.type == IEVENT_MMOUSEUP then
    HUD.Moving = false
    elseif e.type == IEVENT_LMOUSEUP then
    if e.elementid == HUD.Restart then
    _TH__Killed, Time = {}, tosec(os.date("%X"))
    end
    end
    end

    local function displaytext(text, x, y, c)
    addgradcolors(unpack(c))
    local w, h = measurestring(text)
    HUD.ColumnWidth[1], HUD.ColumnWidth[2] = math.max(HUD.ColumnWidth[1], w or 0), math.max(HUD.ColumnWidth[2], h or 0)
    local t = drawroundrect(x, y, HUD.ColumnWidth[1] + 7, HUD.ColumnWidth[2], 2, 2)
    drawtext(text, x + 2, y + math.floor(HUD.ColumnWidth[2] / 4) - 2.55)
    return t
    end

    init end

    auto(100)
    foreach newmessage m do
    if m.type == MSG_INFO then
    local creature = m.content:match(REGEX_LOOT)

    if creature then
    killCount.add(1, creature)
    end
    end
    end

    if HUD.Moving then
    auto(10)
    HUD.Position = {$cursor.x - HUD.Auxiliar[1], $cursor.y - HUD.Auxiliar[2]}
    $chardb:setvalue('AWE.TH', 'POSITION', table.concat(HUD.Position, ':'))
    end

    local x, y = 0, 0


    local x, y = 0, 0

    drawtext('Behemoths killed: ', x, y, HUD.Blue)
    x = x + 85
    displaytext(killCount.get('behemoth'), x, y, HUD.Blue)
    y = y + 16
    drawtext('Hydras killed: ', x-85, y, HUD.Blue)
    x = x + 75
    displaytext(killCount.get('hydra'), x-75, y, HUD.Blue)

    y = y + 20

    setposition(unpack(HUD.Position))

  10. #120
    Free User Stephano's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    430
    Reputation
    43
    Rep Power
    22
    It is not saving the numbers on DB. @Raphael
    Last edited by Stephano; 11-16-2016 at 12:07 AM.

 

 

Posting Permissions

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