Signup Now
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    21

    Soft Boots Duration

    Soft Duration Left


    Description

    Some of you guys might remember this HUD on ElfBot NG, so here's on WindBot.


    Configuration

    Create one persistent hotkey and a HUD with these codes below.


    Screenshots




    Requirements




    Code

    Persistent Hotkey:

    init start
    local function getsecs(msg)
    local times, temp = {m = 60, h = 3600, s = 1}, 0

    for n, t in msg:gmatch('(%d+)%s(%a)') do
    temp = temp + (tonumber(n) * times[t] or 0)
    end

    return temp
    end

    -- SCRIPT VERSION: 1.1.0
    init end


    auto(1000) -- do not change it!
    if not softTime then
    if $feet.id == 3549 then
    contextmenu("Look", $feet.id, "feet") waitping()
    end
    foreach newmessage m do
    if m.type == MSG_INFO then
    local name, duration = m.content:match(REGEX_ITEM_DURATION)
    if duration then
    softTime = getsecs(duration)
    end
    end
    end
    end
    if $feet.id ~= 3549 then
    softTime = false
    end

    if softTime then
    softTime = softTime - 1
    end

    gist


    HUD Script:

    init start
    local fontsize = 7
    local fontspacing = fontsize + 6
    setfontstyle("Tahoma", fontsize, 99, 0xE4B31B, 1)
    setmaskcolorxp(0)
    setposition($clientwin.left + 7, $worldwin.top + 5)
    init end

    softDuration = time(softTime) or 0
    drawtext("Soft Duration: "..softDuration or 0, 2, 2 + fontspacing)

    gist
    Last edited by Donatello; 03-12-2014 at 01:58 AM.

  2. #2
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Very amaze woww

  3. #3
    Administrator Lucas Terra's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    2,202
    Reputation
    141
    Rep Power
    10
    Just to remind you: loadstring(...) will make your script a lot slower, and your scripts might end up with very high CPU usage like some other bots we have out there.

    Well done, by the way.

  4. #4
    Moderator mistgun's Avatar
    Join Date
    Dec 2013
    Location
    Lodz, Poland
    Posts
    1,821
    Reputation
    220
    Rep Power
    26
    Nice one, could be added to MMH or other hud

  5. #5
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Raphael asked me to do a faster function and here it is:

    local function getsecs(msg)
    local times, temp = {m = 60, h = 3600, s = 1}, 0

    for n, t in msg:gmatch('(%d+)%s(%a)') do
    temp = temp + (tonumber(n) * times[t] or 0)
    end

    return temp
    end


    #xupaRaphael

  6. #6
    Moderator Raphael's Avatar
    Join Date
    Dec 2013
    Location
    raphseller.com
    Posts
    2,441
    Reputation
    309
    Rep Power
    28
    Quote Originally Posted by Lucas Terra View Post
    Just to remind you: loadstring(...) will make your script a lot slower, and your scripts might end up with very high CPU usage like some other bots we have out there.

    Well done, by the way.
    You might have won this battle, but you'll never win the war!


  7. #7
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    @Donatello

    Update your script :P

  8. #8
    Free User Donatello's Avatar
    Join Date
    Dec 2013
    Location
    Tuscany, Italy
    Posts
    398
    Reputation
    51
    Rep Power
    21
    Quote Originally Posted by Leonardo View Post
    @Donatello

    Update your script :P
    Updated with your function as it should be, I will be doing a new HUD asap.

  9. #9
    Banned
    Join Date
    Feb 2014
    Location
    Leetstreet
    Posts
    324
    Reputation
    38
    Rep Power
    0
    How do you do that? I mean benchmark lua code in the bot

  10. #10
    Moderator Leonardo's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    758
    Reputation
    77
    Rep Power
    22
    Quote Originally Posted by Hultin View Post
    How do you do that? I mean benchmark lua code in the bot
    local timeBefore = $timems

    -- code

    print($timems - timeBefore)


    I guess it's something like that but slightly better...

 

 

Posting Permissions

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