Signup Now
Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 40

Thread: Task Helper

  1. #21
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by rysiekk View Post
    on one character its working, on second not, what im doing wrong?
    got the same bug like others
    Attachment 4577
    @Leonardo;
    I don't know I can't read the errors.

  2. #22
    Free User downloadkct's Avatar
    Join Date
    Dec 2013
    Location
    Rio de Janeiro
    Posts
    1,167
    Reputation
    25
    Rep Power
    23
    Quote Originally Posted by Leonardo View Post
    Task Helper



    Description

    It'll show the amount of killed monsters selected on your screen and the totals.


    Configuration

    To configurate this script simply use the right mouse click, this will open a menu with all the options available.


    • Show All: Show all the monsters in a separated line.
    • Show Total Only: Show the total amount of monsters only.
    • Reset Monsters: This will set all monsters killed amount to 0. If you're using killCount by Raphael, it'll reset all the monsters on your database too.
    • Reset Timer: Restarts the timer.
    • Reset Both: Resets both timer and monsters.
    • Add Monster: This will ask for a monster name and will add its amount on the display.
    • Remove Monster: This will remove a monster name and its information from the display, this doesn't restart the count of the monster.
    • Scan Targeting: This will pick all the monsters from your targeting list and insert on the display. This will remove any custom monster you inserted with Add Monster option.

    Code

    init start
    --local SCRIPT_VERSION = "3.0.0"

    local TaskHelper = {
    ShowAll = true,
    }

    -- DO NOT EDIT BELOW THIS LINE --

    local hud = {
    -- settings
    pos = {0, 0},
    aux = {0, 0},
    width = 0,
    height = 0,
    moving = false,

    -- colors
    blue = {0.0, color(36, 68, 105, 20), 0.33, color(39, 73, 114, 20), 0.66, color(21, 39, 60, 20)},
    black = {0.0, color(75, 75, 75, 20), 0.33, color(45, 45, 45, 20), 0.66, color(19, 19, 19, 20)},
    orange = {0.0, color(145, 95, 0, 20), 0.33, color(158, 104, 0, 20), 0.66, color(84, 55, 0, 20)},
    }

    local tempPos = $chardb:getvalue('TaskHelper', 'Position')

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

    TaskHelper.Monsters = {}

    if not $chardb:getvalue("TaskHelper", "Monsters") then
    foreach settingsentry e 'Targeting/Creatures' do
    local mname = get(e, 'Name')

    table.insert(TaskHelper.Monsters, mname:lower())
    end

    table.sort(TaskHelper.Monsters)
    $chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
    else
    TaskHelper.Monsters = $chardb:getvalue("TaskHelper", "Monsters"):totable()
    end

    function inputevents(e)
    if e.type == IEVENT_MMOUSEDOWN then
    hud.moving, hud.aux = true, {$cursor.x - hud.pos[1], $cursor.y - hud.pos[2]}
    end

    if e.type == IEVENT_MMOUSEUP then
    hud.moving = false
    $chardb:setvalue('TaskHelper', 'Position', table.concat(hud.pos, ':'))
    end

    if e.type == IEVENT_RMOUSEUP then
    requestmenu(0)
    requestmenuitem(tern(TaskHelper.ShowAll, "Show Total Only", "Show All"))
    requestmenuitem("Reset Timer")
    requestmenuitem("Reset Monsters")
    requestmenuitem("Reset Both")
    requestmenuitem("Add Monster")
    requestmenuitem("Remove Monster")
    requestmenuitem("Scan Targeting")
    end

    if e.type == IEVENT_REQUESTMENU then
    if e.value1 == 0 then
    if e.value2 == 'Show Total Only' or e.value2 == 'Show All' then
    TaskHelper.ShowAll = not TaskHelper.ShowAll
    end

    if e.value2 == 'Reset Timer' or e.value2 == 'Reset Both' then
    $chardb:setvalue("TaskHelper", "Timer", tosec(os.date("%X")))
    end

    if e.value2 == 'Reset Monsters' or e.value2 == 'Reset Both' then
    for k, v in pairs(TaskHelper.Monsters) do
    $chardb:setvalue('TH MonstersKilled', v, 0)

    if killCount then
    killCount.set(0, v)
    end
    end
    end

    if e.value2 == 'Scan Targeting' then
    TaskHelper.Monsters = {}

    foreach settingsentry e 'Targeting/Creatures' do
    local mname = get(e, 'Name')

    if not table.find(TaskHelper.Monsters, mname:lower()) then
    table.insert(TaskHelper.Monsters, mname:lower())
    end
    end

    table.sort(TaskHelper.Monsters)
    $chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
    end

    if e.value2 == 'Add Monster' then
    requesttext(1, 'Name the monster you want to add:')
    end

    if e.value2 == 'Remove Monster' then
    requestmenu(2)

    for _, v in pairs(TaskHelper.Monsters) do
    requestmenuitem(v:capitalizeall())
    end
    end
    end

    if e.value1 == 2 then
    local t = table.find(TaskHelper.Monsters, e.value2:lower())

    if t then
    table.remove(TaskHelper.Monsters, t)
    $chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
    end
    end
    end

    if e.type == IEVENT_REQUESTTEXT then
    if e.value1 == 1 then
    if not table.find(TaskHelper.Monsters, e.value2:lower()) then
    table.insert(TaskHelper.Monsters, e.value2:lower())
    $chardb:setvalue("TaskHelper", "Monsters", table.tostring(TaskHelper.Monsters))
    end
    end
    end
    end

    local tempTime = tosec(os.date("%X"))

    if $chardb:getvalue("TaskHelper", "Timer") then
    if tempTime - $chardb:getvalue("TaskHelper", "Timer") >= 293^2 then
    $chardb:setvalue("TaskHelper", "Timer", tempTime)
    end
    else
    $chardb:setvalue("TaskHelper", "Timer", tempTime)
    end

    filterinput(false, true, false, false)
    setfontstyle('Tahoma', 10, 75, 0xFFFFFF, 1.5, color(0, 0, 0, 50))
    setmaskcolorxp(0)

    init end

    if hud.moving then
    auto(10)
    hud.pos = {$cursor.x - hud.aux[1], $cursor.y - hud.aux[2]}
    end

    if killCount and killCount.lastRan <= 10000 then
    foreach $chardb:sectionvalue sec 'TH MonstersKilled' do
    $chardb:setvalue('TH MonstersKilled', sec.name, killCount.get(sec.name))
    end
    else
    foreach newmessage m do
    if m.type == MSG_INFO then
    local monster = m.content:match("Loot of a?n? (.+): .-")

    if monster then
    monster = (monster:match("the (.+)") or monster):lower()
    $chardb:setvalue('TH MonstersKilled', monster, ($chardb:getvalue('TH MonstersKilled', monster) or 0) + 1)
    end
    end
    end
    end

    local Total, Line = 0, 0
    local msg = "TASK HELPER"
    local strwidth, strheight = measurestring(msg)
    hud.width, hud.height = math.max(hud.width, strwidth or 0), math.max(hud.height, strheight or 0)

    setfillstyle('gradient', 'linear', 2, 0, 0, 0, 16)
    addgradcolors(unpack(hud.blue))
    drawroundrect(0, 0, hud.width + 10, hud.height, 2, 2)
    drawtext(msg, (hud.width - strwidth + 10) * 0.5, (hud.height - strheight) * 0.5)

    setfontsize(8)

    Line = Line + 1.2

    for _, Name in ipairs(TaskHelper.Monsters) do
    local Amount = $chardb:getvalue("TH MonstersKilled", Name)

    if Amount and Amount > 0 then
    if TaskHelper.ShowAll then
    msg = string.format("[%s] Killed: %s | Rate: %s/HR", Name:capitalizeall(), num(Amount), num(math.floor((Amount / (tosec(os.date("%X")) - $chardb:getvalue('TaskHelper', 'Timer')) * 3600))))
    strwidth, strheight = measurestring(msg)
    hud.width, hud.height = math.max(hud.width, strwidth or 0), math.max(hud.height, strheight or 0)

    addgradcolors(unpack(hud.black))
    drawroundrect(0, Line * hud.height, hud.width + 10, hud.height, 2, 2)
    drawtext(msg, (hud.width - strwidth + 10) * 0.5, Line * hud.height + strheight * 0.1)

    Line = Line + 1.2
    end

    Total = Total + Amount
    end
    end

    msg = string.format("Killed: %s - Rate: %s/HR - Timer: %s", num(Total), num(math.floor((Total / (tosec(os.date('%X')) - $chardb:getvalue('TaskHelper', 'Timer')) * 3600))), formattime(tosec(os.date('%X')) - $chardb:getvalue('TaskHelper', 'Timer')))
    strwidth, strheight = measurestring(msg)
    hud.width, hud.height = math.max(hud.width, strwidth or 0), math.max(hud.height, strheight or 0)

    addgradcolors(unpack(hud.orange))
    drawroundrect(0, Line * hud.height, hud.width + 10, hud.height, 2, 2)
    drawtext(msg, (hud.width - strwidth + 10) * 0.5, Line * hud.height + strheight * 0.1)

    Line = Line + 1.2

    setposition(unpack(hud.pos))
    -- this saves 5x more cpu memory than the last task helper version
    setfixedsize(hud.width * 1.1, hud.height * Line)

    Gist
    Lol, i started this script and somehow my windbot stopped responding, i mean, it kept working but i couldnt click inside the bot, the UI of the bot was inoperative
    Old 'n Proud Neobot-Elfbot and blackd user

  3. #23
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Fixed problem with negative values.

    The crashes are something by far unfixable, it's a Windows problem. If you have the crash or bot doesn't responding problem please drawback to v2.x.x

    v2.0.0 download

  4. #24
    Wind Powered dimasdagama's Avatar
    Join Date
    Mar 2014
    Location
    Rio de Janeiro
    Posts
    367
    Reputation
    22
    Rep Power
    21
    @Leonardo is possible to create a script that reset this kill count after killing boss?
    i'm talking about reset this hud and not the script of raphael

  5. #25
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by dimasdagama View Post
    @Leonardo is possible to create a script that reset this kill count after killing boss?
    i'm talking about reset this hud and not the script of raphael
    Ye just use this action:

    local monsterToReset = "Hide"

    $chardb:setvalue("TH MonstersKilled", monsterToReset, 0)


    This will reset for the HUD but it'll still overwrite the value with killCount enabled, so you'll have to do another workaround.

  6. #26
    Free User Kamcio's Avatar
    Join Date
    Jan 2014
    Posts
    164
    Reputation
    37
    Rep Power
    21
    @Leonardo, how to reset time, kill counter please help me ;d
    Sold 435ED to guy on Ventrilo
    Sold 298 EK to NoMercy on iBot Forum Click
    Sold 272 ED to Tomasz on iBot Forum Click
    Bought 360 ED from JayemVps

  7. #27
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Kamcio View Post
    @Leonardo, how to reset time, kill counter please help me ;d
    Right click and choose "Reset Timer".

  8. #28
    Free User Kamcio's Avatar
    Join Date
    Jan 2014
    Posts
    164
    Reputation
    37
    Rep Power
    21
    Quote Originally Posted by Leonardo View Post
    Right click and choose "Reset Timer".
    LOL thx!
    Sold 435ED to guy on Ventrilo
    Sold 298 EK to NoMercy on iBot Forum Click
    Sold 272 ED to Tomasz on iBot Forum Click
    Bought 360 ED from JayemVps

  9. #29
    Free User
    Join Date
    May 2015
    Posts
    3
    Reputation
    10
    Rep Power
    0
    ele ta contando de 3 em 3 , ta bugado tem como ajeita nao ?

  10. #30
    Free User
    Join Date
    Apr 2014
    Posts
    24
    Reputation
    10
    Rep Power
    0
    Quote Originally Posted by Leonardo View Post
    Ye just use this action:

    local monsterToReset = "Hide"

    $chardb:setvalue("TH MonstersKilled", monsterToReset, 0)


    This will reset for the HUD but it'll still overwrite the value with killCount enabled, so you'll have to do another workaround.
    Can you explain me a little more?, what else need to be implemented for this to work?

 

 

Posting Permissions

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