i convert walukasz mage script
problems:
- when reaching Y cap windbot makes GP off than ignore
- while being surrounded by monsters, bot walking by 2 free sqm north-south and ignoring healing or even casting spells
- (Action: 415) Couldn't find item named 'giant shimmering pearl'. Future warnings for this script will be shown in the Debug Script Log.
- wont deposit items
Code:
setsetting("Looting/OpenNextBP", "no")
while windowcount(LootBP) ~= 1 or windowcount() ~= 1 do
closewindows()
wait(500, 800)
openitem(MainBP, "back")
wait(500, 800)
openitem(LootBP, MainBP, false)
wait(700, 900)
resizewindows(100, LootBP, true)
wait(500, 800)
end
while windowcount(MainDPBP) == 0 do
setsetting("Looting/OpenNextBP", "no")
reachgrounditem("depot")
wait(1000, 1500)
openitem("depot")
wait(900, 1400)
openitem(3502, "locker")
wait(900, 1400)
openitem(MainDPBP, "Depot Chest")
wait(900, 1400)
resizewindows(100, MainDPBP, true)
end
local CONFIG = {
LOOT_BACKPACK = LootBP,
STACKABLE_BACKPACK = AddonDPBP,
STACKABLE_BACKPACK_AMOUNT = itemcount(AddonDPBP),
NOT_STACKABLE_BACKPACK = RandomDPBP,
NOT_STACKABLE_BACKPACK_AMOUNT = itemcount(RandomDPBP),
DEPOSIT_ITEMS = {"fish fin", "deepling claw", "deepling ridge", "deeptags", "spellsinger's seal", "small emerald", "small sapphire", "deepling guard belt buckle", "great health potion", "deepling warts", "eye of a deepling", "great mana potion", "deepling breaktime snack", "rust remover", "deepling scales", "giant shimmering pearl", 281, 282, 14044, 14041, 14013, 14008, 14010, 14012, 12730, 14011, 14017, "foxtail", "ornate crossbow", "warrior's axe", "deepling backpack", "warrior's shield", "guardian axe", "deepling squelcher", "deepling staff", "necklace of the deep", "heavy trident", "key to the drowned library", "life ring", 14142, 14247, 14040, 14248, 14042, 14043, 14250, 13987, 13990, 14009}, }
local NOT_STACKABLE_LAST_ON_TO, ITEM_INDEX = 0, 1
while (#CONFIG.DEPOSIT_ITEMS >= ITEM_INDEX) do
if (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "string") then
local ITEM_ID = itemid(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX])
if (ITEM_ID > 0) then
CONFIG.DEPOSIT_ITEMS[ITEM_INDEX], ITEM_INDEX = ITEM_ID, ITEM_INDEX + 1
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
elseif (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "number") then
if (CONFIG.DEPOSIT_ITEMS[ITEM_INDEX] > 0) then
ITEM_INDEX = ITEM_INDEX + 1
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
end
while (true) do
for _, DEPOSIT_ITEM in ipairs(CONFIG.DEPOSIT_ITEMS) do
if (itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK) > 0) then
if (iteminfo(DEPOSIT_ITEM).isCumulative) then
local STACKABLE_LAST_ON_TO = 0
while (CONFIG.STACKABLE_BACKPACK_AMOUNT > STACKABLE_LAST_ON_TO) do
local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
moveitemsonto(DEPOSIT_ITEM, CONFIG .STACKABLE_BACKPACK,STACKABLE_LAST_ON_TO, nil, "all", 100) wait(200, 250)
local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
STACKABLE_LAST_ON_TO = STACKABLE_LAST_ON_TO + 1
elseif (ITEM_COUNT_AFTER == 0) then
break
end
end
else
while (CONFIG.NOT_STACKABLE_BACKPACK_AMOUNT > NOT_STACKABLE_LAST_ON_TO) do
local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
moveitemsonto(DEPOSIT_ITEM, CONFIG .NOT_STACKABLE_BACKPACK,NOT_STACKABLE_LAST_ON_TO, nil, "all", 100) wait(200, 250)
local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
NOT_STACKABLE_LAST_ON_TO = NOT_STACKABLE_LAST_ON_TO + 1
elseif (ITEM_COUNT_AFTER == 0) then
break
end
end
end
end
end
if (itemcount(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK) > 0) then
openitem(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK, false) wait(1800, 2000)
else
break
end
wait(100, 200)
end
if DepositDeeplingBPs then
while windowcount(MainBP) ~= 1 or windowcount() ~= 1 do
closewindows()
wait(500, 800)
openitem(MainBP, "back")
wait(500, 800)
resizewindows(100, MainBP, true)
wait(500, 800)
end
if itemcount("deepling backpack") > 0 then
while windowcount(MainDPBP) == 0 do
setsetting("Looting/OpenNextBP", "no")
reachgrounditem("depot")
wait(1000, 1500)
openitem("depot")
wait(900, 1400)
openitem(3502, "locker")
wait(900, 1400)
openitem(MainDPBP, "Depot Chest")
wait(900, 1400)
resizewindows(100, MainDPBP, true)
end
local CONFIG = {
LOOT_BACKPACK = MainBP,
STACKABLE_BACKPACK = AddonDPBP,
STACKABLE_BACKPACK_AMOUNT = itemcount(AddonDPBP),
NOT_STACKABLE_BACKPACK = RandomDPBP,
NOT_STACKABLE_BACKPACK_AMOUNT = itemcount(RandomDPBP),
DEPOSIT_ITEMS = {"deepling backpack"}, }
local NOT_STACKABLE_LAST_ON_TO, ITEM_INDEX = 0, 1
while (#CONFIG.DEPOSIT_ITEMS >= ITEM_INDEX) do
if (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "string") then
local ITEM_ID = itemid(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX])
if (ITEM_ID > 0) then
CONFIG.DEPOSIT_ITEMS[ITEM_INDEX], ITEM_INDEX = ITEM_ID, ITEM_INDEX + 1
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
elseif (type(CONFIG.DEPOSIT_ITEMS[ITEM_INDEX]) == "number") then
if (CONFIG.DEPOSIT_ITEMS[ITEM_INDEX] > 0) then
ITEM_INDEX = ITEM_INDEX + 1
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
else
table.remove(CONFIG.DEPOSIT_ITEMS, ITEM_INDEX)
end
end
while (true) do
for _, DEPOSIT_ITEM in ipairs(CONFIG.DEPOSIT_ITEMS) do
if (itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK) > 0) then
if (iteminfo(DEPOSIT_ITEM).isCumulative) then
local STACKABLE_LAST_ON_TO = 0
while (CONFIG.STACKABLE_BACKPACK_AMOUNT > STACKABLE_LAST_ON_TO) do
local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
moveitemsonto(DEPOSIT_ITEM, CONFIG .STACKABLE_BACKPACK,STACKABLE_LAST_ON_TO, nil, "all", 100) wait(200, 250)
local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
STACKABLE_LAST_ON_TO = STACKABLE_LAST_ON_TO + 1
elseif (ITEM_COUNT_AFTER == 0) then
break
end
end
else
while (CONFIG.NOT_STACKABLE_BACKPACK_AMOUNT > NOT_STACKABLE_LAST_ON_TO) do
local ITEM_COUNT_BEFORE = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
moveitemsonto(DEPOSIT_ITEM, CONFIG .NOT_STACKABLE_BACKPACK,NOT_STACKABLE_LAST_ON_TO, nil, "all", 100) wait(200, 250)
local ITEM_COUNT_AFTER = itemcount(DEPOSIT_ITEM, CONFIG.LOOT_BACKPACK)
if (ITEM_COUNT_BEFORE == ITEM_COUNT_AFTER and ITEM_COUNT_AFTER > 0) then
NOT_STACKABLE_LAST_ON_TO = NOT_STACKABLE_LAST_ON_TO + 1
elseif (ITEM_COUNT_AFTER == 0) then
break
end
end
end
end
end
if (itemcount(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK) > 0) then
openitem(CONFIG.LOOT_BACKPACK, CONFIG.LOOT_BACKPACK, false) wait(1800, 2000)
else
break
end
wait(100, 200)
end
end
end
gotolabel("open_bps")