Log in

View Full Version : Selling loot script



Skaaven
01-20-2017, 01:37 AM
Hello guys i have an question to ppls which know lua better than me.

There is a script which are working, but when my character sold the loot then my bot is stuck. Cavebot is off.
Could someone edit this script to be correct ?




registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")

function onWalkerSelectLabel(labelName)

if (labelName == "Sell") then
setBotEnabled(false)
Self.Say("hi")
sleep(math.random(1500, 2000))
Self.SayToNpc("trade")
sleep(math.random(2000, 2700))
SELL_ITEMS = {"glooth axe", "glooth blade", "rubber cap", "glooth club", "heat core", "glooth cape", "glooth amulet"}
for _, ITEM_NAME in ipairs(SELL_ITEMS) do
if (Self.ShopGetItemSaleCount(ITEM_NAME) > 0) then
Self.ShopSellAllItems(ITEM_NAME)
wait(300, 500)
end
end
end
end

Tirell
01-20-2017, 02:27 AM
local itemsToSell = {'glooth axe', 'glooth blade', 'rubber cap', 'glooth club', 'heat core', 'glooth cape', 'glooth amulet'}

registerEventListener(WALKER_SELECTLABEL, 'onWalkerSelectLabel')
function onWalkerSelectLabel(labelName)
if (labelName == 'Sell') then
if (Self.ItemCount(itemsToSell[i])) then
Walker.Stop()
Self.SayToNpc({'hi', 'trade'}, 65)
wait(Self.Ping() + 40, Self.Ping() + 70)
for i = 1, #itemsToSell do
wait(150, 200)
Self.ShopSellAllItems(itemsToSell[i])
end
end
Walker.Start()
end
end

Skaaven
01-20-2017, 09:35 AM
Still, situation is the same :(

Already, i dont have problem with selling items, but i have problem with now enabling cavebot after do the seller action

Skaaven
01-20-2017, 09:52 AM
Ok i gotcha, I repaired that
Thanks for answering back
gl :)