Like stated in Title, bot buys potion and trowbag, even when i have them.
i guess its because im botting in a region where i can only buy lower potions and trowbags, but should bot not be able to detect the higher ones anyway?
it should not buy lower ones if higher ones are present right?
Botje
Bot buys Potions and trowbag when allready there
Re: Bot buys Potions and trowbag when allready there
If it does, then it shouldn't. I'll look into it.
What it should do is, after finding the best store item, it should check the inventory and see how many items (of whatever level) are better than it. If there are more than the required amount, it doesn't buy any.
What it should do is, after finding the best store item, it should check the inventory and see how many items (of whatever level) are better than it. If there are more than the required amount, it doesn't buy any.
Last edited by rock5 on Fri Dec 03, 2010 5:50 am, edited 1 time in total.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Bot buys Potions and trowbag when allready there
cool, thanx man 
Re: Bot buys Potions and trowbag when allready there
Ok Ive done it but I couldn't be bothered to properly test it as I don't usually use consumables and would have to do too much, to set up conditions like you described, to do a test.
Could you just replace the whole storeBuyConsumable function in your inventory.lua with this code and see how it goes?
Could you just replace the whole storeBuyConsumable function in your inventory.lua with this code and see how it goes?
Code: Select all
function CInventory:storeBuyConsumable(type, quantity)
-- Find best store item
local bestLevel = 0;
for storeSlot = 1, 28, 1 do
local storeItemLink, icon, name, storeItemCost = RoMScript("GetStoreSellItemLink("..storeSlot.."),GetStoreSellItemInfo("..storeSlot..")");
if (storeItemLink == "" or storeItemLink == nil) then
break;
end
storeItemId, storeItemColor, storeItemName = CItem:parseItemLink(storeItemLink);
-- printf("%s %s\n", storeItemId, storeItemName);
local consumable = database.consumables[storeItemId];
if( consumable
and consumable.Type == type
and consumable.Level <= player.Level ) then
if consumable.Level > bestLevel then
bestLevel = consumable.Level;
bestItem = storeItemId;
bestItemSlot = storeSlot;
end
end
end
if bestLevel == 0 then
return false;
end
-- Count number of better items in inventory
self:update();
local totalCount = 0;
for slot,item in pairs(self.BagSlot) do
local consumable = database.consumables[item.Id];
if item.Available and
consumable and
consumable.Type == type and
consumable.Level >= bestLevel then
totalCount = totalCount + item.ItemCount
end;
end;
-- See how many needed
if totalCount < quantity then
numberToBuy = quantity - totalCount;
printf(language[1001]); -- Shopping
for i = 1, numberToBuy, 1 do
RoMScript("StoreBuyItem("..bestItemSlot..")");
printf(".");
end
printf("\n");
end
return true;
end- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Bot buys Potions and trowbag when allready there
nice, works fine so far, doesnt buy any other items now 
Botje
Botje
Re: Bot buys Potions and trowbag when allready there
Committed to rev 532.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Bot buys Potions and trowbag when allready there
Is it possible to select what potions bot is buying?
Re: Bot buys Potions and trowbag when allready there
Why would you want that? Isn't the highest one always the best?Giram wrote:Is it possible to select what potions bot is buying?
It wouldn't be much of a auto buy function if you had to specify which potions to buy.
Which gives me a thought. Let me just check...
Yep, I forgot to check if the inventory potions are lower than the player level. Which means, when checking to see if you have higher lever items in your inventory, it will include ones that are too high for your player to use.
I'll have to fix that.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan
Re: Bot buys Potions and trowbag when allready there
Finally added this fix in rev 536.rock5 wrote:I forgot to check if the inventory potions are lower than the player level. Which means, when checking to see if you have higher lever items in your inventory, it will include ones that are too high for your player to use.
I'll have to fix that.
- Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
- I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
- How to: copy and paste in micromacro
________________________
Quote:- “They say hard work never hurt anybody, but I figure, why take the chance.”
- Ronald Reagan