local mBag = player:findNearestNameOrId(GetIdName(105930))
if mBag and inventory:itemTotalCount(0) ~= 0 then
print("\n\n found bag \n\n")
player:target_Object(mBag.Id)
yrest(1000) -- If not enough time to pick up bag, increase it.
player:target_Object(mBag.Id)
yrest(1000)
end
Since the name hasn't changed then it will still work for any language.
Remember no matter you do in life to always have a little fun while you are at it
I rewrote your bags routing a year ago but hesitated to post it since it never misses any bags but being so near 100 it does not matter much now.
Here is my super improved bag looter for all zones so far till the jungle. this will get more bags.
-- get gift bags
local mBag=player:findNearestNameOrId({107447,105930,105982,107217,107442,107444,107445,107446})
if mBag ~= nul then
player:lootAll();
yrest(1000);
player:target_Object(mBag.Id,100,true,true)
else local mBag=nul
end
The list of id's is to get every bag in every zone I came across.
Lisa was the original code I used but I watched it run over time and if you were in party the timing on bags would take longer and it would miss a lot of them. If you solo the timing would be less and you don't need the extra wait. yrest(1000); this number needs be lots bigger to not miss any on Lisa's version.
The changes I made cause it to only wait the time needed and to not leave before it gets the bag. Its makes Lisa waypoint lots better. I could have not made it without Lisa's but from reading lots of other people code I found this change (mBag.Id,100,true,true) made the difference.
The lootall was just to clean up mobs before getting bag. I keep loot after kill set to false.
I made this with one of her first versions. It works perfectly every time.
Yeah, maybe your target_Object settings would work better. I think those settings will make it keep trying until it successfully loots the bag. And maybe it would be a good idea to loot first before trying to get the bag, so it gives the bag more time to be lootable. Although with those fail-safe target_Object settings it's probably not necessary. You couldn just leave the looting to the profile loot settings. It may even be possible that by going to loot other bodies you might go out of range of the bag. I believe looting range is usually larger than target_Object range which uses HARVEST_DISTANCE which is usually 120.
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.
<onLeaveCombat><![CDATA[
-- get gift bags
local mBag=player:findNearestNameOrId({107447,105930,105982,107217,107442,107444,107445,107446})
if mBag ~= nul then
player:lootAll();
yrest(1000);
player:target_Object(mBag.Id,100,true,true)
else local mBag=nul
end
-- Additional Lua code to execute after killing an enemy
]]></onLeaveCombat>
<onLeaveCombat><![CDATA[
-- get gift bags
local mBag = player:findNearestNameOrId(GetIdName(105930))
if mBag and inventory:itemTotalCount(0) ~= 0 then
print("\n\n found bag \n\n")
player:target_Object(mBag.Id)
yrest(1000) -- If not enough time to pick up bag, increase it.
player:target_Object(mBag.Id)
yrest(1000)
end
-- Additional Lua code to execute after killing an enemy
]]></onLeaveCombat>
-- get gift bags
local mBag = player:findNearestNameOrId({107447,105930,105982,107217,107442,107444,107445,107446,107448,107449})
if mBag ~= nul then
yrest(1000);
if (player.Class1 == CLASS_ROGUE) and (not player:hasBuff("500675")) then
player:cast("ROGUE_HIDE");
end
yrest(10000);
player:target_Object(mBag.Id,100,true,true)
player:lootAll(); -- you may not need this line depending on your loot settings
else local mBag=nul
end
I don't play the game anymore so I'm not sure, but I can only think of two reasons why it wouldn't work.
First:
Vengefulmilk wrote:Hey guys, with the newest zone some of the bags bug out and you'll need to add 107446 in to loot them. Works flawlessly for me now that bags were dropping with the names Sys107446 or something similar.
So like said above, if the bags don't have proper names, like Sys_somenumbers_Name, then finding it through its name will not work.
Second:
If your code lists the Ids to find in a table, then it's highly likely the Id for the new zone bags are not the same. You'll have to add the Id to the table of Ids first.
-- get gift bags
if player:findNearestNameOrId("Gift Bag") or player:findNearestNameOrId("Mysterious Bag") then
player:lootAll()
rest(1000);
if (player.Class1 == CLASS_ROGUE) and (not player:hasBuff("500675")) then
player:cast("ROGUE_HIDE");
end
rest(10000);
player:target_Object("Gift Bag",100,true,true)
player:target_Object("Mysterious Bag",100,true,true)
else
end
-- get mirror chests
local mBag = player:findNearestNameOrId(GetIdName(104529))
if mBag and inventory:itemTotalCount(0) ~= 0 then
print("\n\n found bag \n\n")
player:target_Object(mBag.Id)
yrest(1000) -- If not enough time to pick up bag, increase it.
player:target_Object(mBag.Id)
yrest(1000)
end