XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 9 of 9

Thread: XenoBot does't sell of items that I'm wearing!

  1. #1
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb XenoBot

    xxxxxxxxxx
    Last edited by Elizabeth; 04-01-2022 at 06:12 AM.

  2. #2
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    It's actually Tibia that does this. Right click on the trade window and you'll be able to change the setting that prevents you from selling your equipment.

    Imo the real problem is that Self.ShopGetItemSaleCount() reports your equipment as sellable regardless of your trading settings. Because of this people get stuck in infinite loops whenever they try to sell something that they are also wearing. This can be worked around in lua, but almost no scripts do it.

  3. #3
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    It's actually Tibia that does this. Right click on the trade window and you'll be able to change the setting that prevents you from selling your equipment.

    Imo the real problem is that Self.ShopGetItemSaleCount() reports your equipment as sellable regardless of your trading settings. Because of this people get stuck in infinite loops whenever they try to sell something that they are also wearing. This can be worked around in lua, but almost no scripts do it.
    So, I understand, that nothing can be done with this problem?
    The only way out is wearing a different eq?

  4. #4
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    If you do want to sell your equipment you just need to change your trade settings. If you don't want to get stuck in a loop you need a better script.

  5. #5
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    If you do want to sell your equipment you just need to change your trade settings. If you don't want to get stuck in a loop you need a better script.
    I don't want sell my equipment, whether u are in possession of this better script?
    Or whether u can create such?

  6. #6
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    I'm at work atm, but I've posted it on the forums on several occasions before.

  7. #7
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Add this to the beginning of your script and it should work (unless you're using someone's encrypted xblua, then you need to contact the creator):

    lua code:

    local saleCountWithEq = Self.ShopGetItemSaleCount
    function Self.ShopGetItemSaleCount(item)
    local id = Item.GetItemIDFromDualInput(item)

    local function countInEquipment()
    local count = 0
    local slots = {Self.Head, Self.Armor, Self.Legs, Self.Feet, Self.Amulet, Self.Weapon, Self.Ring, Self.Shield, Self.Ammo}
    for _, slot in ipairs(slots) do
    local item = slot()
    if item.id == id then
    count = count + math.max(item.count, 1)
    end
    end
    return count
    end

    return saleCountWithEq(id) - countInEquipment()
    end

  8. #8
    Elizabeth's Avatar
    Join Date
    Mar 2016
    Location
    Poland
    Posts
    72
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by shadowart View Post
    Add this to the beginning of your script and it should work (unless you're using someone's encrypted xblua, then you need to contact the creator):

    lua code:

    local saleCountWithEq = Self.ShopGetItemSaleCount
    function Self.ShopGetItemSaleCount(item)
    local id = Item.GetItemIDFromDualInput(item)

    local function countInEquipment()
    local count = 0
    local slots = {Self.Head, Self.Armor, Self.Legs, Self.Feet, Self.Amulet, Self.Weapon, Self.Ring, Self.Shield, Self.Ammo}
    for _, slot in ipairs(slots) do
    local item = slot()
    if item.id == id then
    count = count + math.max(item.count, 1)
    end
    end
    return count
    end

    return saleCountWithEq(id) - countInEquipment()
    end
    Tack sa mycket

  9. #9
    Moderator shadowart's Avatar
    Join Date
    Dec 2014
    Location
    Sweden
    Posts
    1,985
    Mentioned
    225 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by Elizabeth View Post
    Tack sa mycket
    Nie ma za co.

Posting Permissions

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