Signup Now
Results 1 to 6 of 6
  1. #1
    Moderator Josh's Avatar
    Join Date
    Dec 2013
    Posts
    1,262
    Reputation
    164
    Rep Power
    11

    Simple XJHUD - General information and engine state switches

    There was a lot of talk recently about how HUDs were super laggy on VPS, and personally I'm not a fan of having 2 huge colourful blocks at each side of the screen, so I decided to come up with what I think is an ideal solution to both problems... I give you, XJHUD:



    It's not exactly the most stylish, and the code behind it is absolutely disgusting right now (it's basically hacked together from a variety of other HUDs), but it does work and it should be fairly efficient for VPS purposes. It looks the part for my purposes also. There are no gradients to render (which could be a cause of resource consumption on VPS), and the information is concise but useful. There are no useless labels to render, and it should show all the information required. To elaborate on what information is listed:

    • Experience to level / Time to level
    • Experience per hour
    • Stamina remaining
    • Ping
    • Item ID of item under mouse cursor
    • Loot - Waste = profit/waste
    • State switches for cavebot, looting, targeting, spell healer, potion healer, condition healer, mana trainer.


    It's worth noting that in the screenshot it lists the number of mana potions left. I removed that from the code below but it could be re-added by adding a newline before line #75 with the following:

    {color = 0xcccccc, text = 'Manas: ', value = servercount("strong mana potion") .. " MP"},


    Change "strong mana potion" for your getuseroption() or whatever. I don't think this is valuable to most people but I'm using this script to semi-afk bot a bit so I found it quite useful.

    It might also be useful to know that I am using Ubuntu font - it's available free of charge on the Ubuntu Font website, alternatively you can edit line #41 where the font is specified. I have some serious wood for Ubuntu font so y'know, I highly recommend it.

    Please accept my most sincere apologies for the state of the code. I will work on improving it when I next get a chance.

    init start
    setposition($clientwin.left+8, $clientwin.top+8)
    local cursorPosition = {}
    local moving
    local engines = {'Cavebot', 'Looting', 'Targeting', 'Spell Healer', 'Potion Healer', 'Condition Healer', 'Mana Trainer'}
    filterinput(false, true, false, false)
    function inputevents(e)
    if e.type == IEVENT_LMOUSEUP then
    if e.elementid == closeButton then
    closed = true
    return
    end

    for _, v in ipairs(engines) do
    if e.elementid == v.shape then
    toggle(v.name:gsub(' ', '') .. '/Enabled')
    return
    end
    end
    elseif e.elementid ~= nil then
    if e.type == IEVENT_MMOUSEDOWN then
    moving = true
    cursorPosition.x = $cursor.x
    cursorPosition.y = $cursor.y
    return
    elseif e.type == IEVENT_MMOUSEUP then
    moving = false
    return
    end
    end
    end
    for k, v in ipairs(engines) do
    engines[k] = {
    name = v,
    shape = nil
    }
    end

    local fontsize = 10
    local fontspacing = fontsize + 4
    setfontstyle("Ubuntu", 10, 100, 0xCCCCCC, 1, 0x555555)

    local maxsize = 150

    setmaskcolorxp(0)
    init end

    auto(100)
    if moving then
    auto(10)
    local curPosition = getposition()
    setposition(
    curPosition.x + ($cursor.x - cursorPosition.x),
    curPosition.y + ($cursor.y - cursorPosition.y)
    )
    cursorPosition.x = $cursor.x
    cursorPosition.y = $cursor.y
    end

    lootedvalue = 0
    usedvalue = 0
    foreach supplyitem m do
    usedvalue = usedvalue + m.amountused * m.buyprice
    end
    foreach lootingitem m do
    lootedvalue = lootedvalue + m.amountlooted * m.sellprice
    end

    local info = {
    {color = 0xcccccc, text = 'Level up: ', value = num($exptonextlevel) .. ' exp / ' .. time(timetolevel()) .. " m"},
    {color = 0xcccccc, text = 'Per hour: ', value = "X: " .. num($exphour/1000) .. "k/h | " .. "P: " .. num((lootedvalue - usedvalue) / ((($charactertime/1000)/60)/60)/1000) .. "k/h" },
    {color = 0xcccccc, text = 'Stamina: ', value = num($stamina / 60) .. " h " .. num($stamina % 60) .. " m"},
    {color = 0xcccccc, text = 'Ping: ', value = num($pingaverage) .. " ms"},
    {color = 0xcccccc, text = 'ItemID: ', value = "ID: " .. $cursorinfo.id},
    {color = 0xcccccc, text = 'Profit: ', value = math.floor(lootedvalue/1000) .. 'k - ' .. math.floor(usedvalue/1000) .. 'k = ' .. math.floor(lootedvalue / 1000) - math.floor(usedvalue / 1000) .. 'k'},
    }


    for i,j in ipairs(info) do
    local posy = (i-1)*fontspacing
    setfontcolor(j.color)
    drawtext(j.value, 0, posy)
    end

    local startStatesY = (table.getn(info) * fontspacing) - 18

    local isEnabled

    for k, v in ipairs(engines) do
    isEnabled = get(v.name:gsub(' ', '') .. '/Enabled') == 'yes'
    setfillstyle('color', tern(isEnabled, 0x175B00, 0x7E241B))
    engines[k].shape = addshape('roundrect', 0, k * 23 + startStatesY, 120, 20, 3, 3)
    addtext(v.name, 6 + tern(isEnabled, 0, 0), k * 23 + 3 + startStatesY)
    end
    Last edited by Josh; 02-14-2017 at 09:54 AM.
    Interested in software development and/or programming for Tibia?
    Check out the new Tibia Programming Forums (TibiaPF) by clicking the image below.

    Looking for a bot for the MMORPG, Medivia?
    Check out MediviaBotter, a powerful, injected bot by clicking the link below.


  2. #2

  3. #3
    Banned
    Join Date
    Dec 2016
    Location
    Jams
    Posts
    166
    Reputation
    26
    Rep Power
    0
    good job!!! It would not be better to be 26k - 99k = PROFIT/HOUR and not 73k??

  4. #4
    Moderator Josh's Avatar
    Join Date
    Dec 2013
    Posts
    1,262
    Reputation
    164
    Rep Power
    11
    Quote Originally Posted by Xixico View Post
    good job!!! It would not be better to be 26k - 99k = PROFIT/HOUR and not 73k??
    Possibly, I can add it in so it also lists profit/h. Will do so shortly and update. Realistically I'm developing this for the "quick glance", and I made it as I was botting semi-afk, so I just wanted to have the instant "you've spent XYZ so far" number...
    Interested in software development and/or programming for Tibia?
    Check out the new Tibia Programming Forums (TibiaPF) by clicking the image below.

    Looking for a bot for the MMORPG, Medivia?
    Check out MediviaBotter, a powerful, injected bot by clicking the link below.


  5. #5
    Free User Stephano's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    437
    Reputation
    37
    Rep Power
    8
    I don't know if I will be useful, but the reason why HUDs were lagging my VPS is this:
    https://forums.tibiawindbot.com/show...ncreasing-ping

  6. #6
    Free User
    Join Date
    Oct 2016
    Posts
    77
    Reputation
    15
    Rep Power
    2
    Hello and thnaks.

    Maybe is my vps or my config but I see the hud on this way..
    HUD.PNG
    Sold EK 150+ 41 Days Voucher to @Neoxx at XB Forums
    Bought RP 114 from @pibil
    Scammed by @Jwberry

 

 

Posting Permissions

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