Everyone who has never used our Bots before, can test each one for 2 days without any limitation.
The trial is given automatically when you login on the Bot, but in some cases it wouldn't work (security reasons).
If this happens, send me a private message and i will be checking the failed trials manually and adding it for those who didn't get it.
We are looking for resellers who may accept payment methods different from ours, including classictibia's cash, realesta's cash, mastercores' cash, etc. Interested? Click here at anytime.



Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loot Seller - useitemonitem
#1
Im trying to make a script to use Loot Seller (its a item) in a list of itens (loot).

The items are inside the corpses, but it wouldn't be a problem to move them to the backpack if necessary.

I tried this but it didn't work

local Loot_Seller = 23722 -- Loot Seller id.
local Itens = { 'Viking Helmet','Sword','Mace','Brass Helmet','Brass Shield' }

local containers = getcontainers()
for _, cont in ipairs(containers) do
    for __, item in ipairs(cont.items) do
        if item.name == Itens then
            useitemonitem(Loot_Seller, item.index, cont.index)
            wait(500, 800)
            return
        end
    end
end
Reply

#2
bump? anyone?
Reply

#3
local Loot_Seller = 23722 -- Loot Seller id.
local Items = { 'Viking Helmet','Sword','Mace','Brass Helmet','Brass Shield' }

if connected() then
    local containers = getcontainers()
    for _, cont in ipairs(containers) do
        for __, item in ipairs(cont.items) do
            if table.find(Items, item.name) ~= nil then
                useitemonitem(Loot_Seller, item.id, cont.index)
                wait(500, 800)
                return
            end
        end
    end
end

The solution is ideal for common items, but not good for custom items, because may not know its name. So i've applied changes to make it work with item names and ids. So you can add item names and ids to Items table. I recommend to use Ids, because it will never be wrong.
local Loot_Seller = 23722 -- Loot Seller id.
local Items = { 'Viking Helmet','Sword','Mace','Brass Helmet','Brass Shield' }

if connected() then
    table.id(Items)
    
    local containers = getcontainers()
    for _, cont in ipairs(containers) do
        for __, item in ipairs(cont.items) do
            if table.find(Items, item.id) ~= nil then
                useitemonitem(Loot_Seller, item.id, cont.index)
                wait(500, 800)
                return
            end
        end
    end
end
Reply

#4
|Only Registered members can see download links. | Click here to buy subscription or here to register.

22:48:23 - LUA Script -> Persistent01: 12: unexpected symbol near '.'
Probably on useitemonitem(Loot_Seller, item.id, .index, cont.index)
Reply

#5
fixed
Reply

#6
LUA Script -> Console: 11: unexpected symbol near '.'

getting this trying to run this scrtipt
Reply

#7
|Only Registered members can see download links. | Click here to buy subscription or here to register.
which one mate? there are 2 scripts. it's likely that you ran a script that murilodombeck quoted, not from my post.
Reply

#8
|Only Registered members can see download links. | Click here to buy subscription or here to register.


I dont get the error message anymore but the script doesn't do anything when I run it
Reply

#9
works perfectly for me, only issue is 2 problems. if the interval is too high then the bot will open bags and script wont have time to use the seller on the item, on the other hand if its too low then the bot will accidentally pick up bags while trying to loot gp/sell the item. any suggestion on proper interval? thanks for the script! great service as always Arkilys!
Reply

#10
Honestly, i think the only safe way is to let Bot loot the items then use loot seller. I will think about the idea of adding an option on Looter to use item on loot on Action field, so Looter options will be enough for you needs.

You can use the same script, but adding another validation islooting()... So the script will only sell items when Bot is not currently looting.
Replace:
if connected() then
with
if connected() and islooting() == false then

Example:
local Loot_Seller = 23722 -- Loot Seller id.
local Items = { 'Viking Helmet','Sword','Mace','Brass Helmet','Brass Shield' }

if connected() and islooting() == false then
    local containers = getcontainers()
    for _, cont in ipairs(containers) do
        for __, item in ipairs(cont.items) do
            if table.find(Items, item.name) ~= nil then
                useitemonitem(Loot_Seller, item.id, cont.index)
                wait(500, 800)
                return
            end
        end
    end
end
Reply



Forum Jump:



Forum software by © MyBB Theme © iAndrew 2016