timbob
12-22-2016, 09:54 PM
it see's the bp and opens it like it should but then when looting it drops the gold into the main bp.
using nixez venore rotworms script everything looks right to what ive been reading must be missing something silly.
i have a normal bp as my main backpack and 4 golden backpacks stacked inside eachother inside that main bp, when it does "resetting bp's" it opens it up so i know it detects it, but it fails to put gold coins in there.
--- MISC Info
--- Your #1 BP inside depot will recieve stackables.
--- Your #2 BP inside depot will recieve non-stackables.
-----------------------------------------------------------------------------------------------------------------------
--- BP Settings ---
local GoldBP = "Golden Backpack" --- Your gold backpack (use same colors inside)
-----------------------------------------------------------------------------------------------------------------------
--- Hunt Settings ---
local CapLeave = 10 --- Leave spawn if cap is below this.
--Potions Setup
local MPBuy = 15 --- Amount of mana pots to bring on hunt.
local MPLeave = 10 --- Leave spawn if mana potions is below this.
local ManaPots = 268 --- ID of your manapots.
local HealthPots = 266 ----Id Of Your healthpots.
local HPBuy = 5 -- Amount of health pots to bring on hunt.
local HpLeave = 1 --- Leave spawn if mana potions is below this.
---Paladin Options----
local AmmoID = 7378 ---Id of Ammo To refill <<Royal spear 7378>>>
local MaxAmmo = 10 --------How many ammo you wanna withdraw from depot
local AmmoDP = 2 -- Slot of DP that will be for your ammunition. 0 is first backpack 1 is second backpack 2 is third backpack ETC
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print([[
------Venore East rotworms[Knight]----
----This script was created by:----
----------------Nixez-------------
----------Happy Hunting!-----------
-----------------------------------]])
wait(7000)
function onWalkerSelectLabel(labelName)
if (labelName == "suppcheck") then
if (Self.ItemCount(HealthPots) < HpLeave) then
Walker.Goto("Leavecave")
print([[Low Health pots.]])
elseif (Self.ItemCount(ManaPots) < MPLeave) then
Walker.Goto("Leavecave")
print([[Low mana pots, Going Refill ]])
else
Walker.Goto("start")
print([[Enough supplies & cap.]])
end
elseif (labelName == "BP") then
Walker.Stop()
print([[Resetting BP..]])
wait(1000,2000)
Self.CloseContainers()
wait(2000,3000)
Self.OpenMainBackpack(true):OpenChildren({Item.Get ID(GoldBP), true})
wait(2000,3000)
Walker.Start()
elseif (labelName == "deposit") then
Walker.Stop()
wait(1600,2400)
Self.DepositItems({9689, 0}, {8031, 0}, {10275, 0}, {9692, 0}, {5894, 0})
wait(500,1500)
Self.DepositItems({11485, 0}, {12600, 0}, {10276, 0})
if (Self.Stamina() < 960) then
Walker.Stop()
else
Walker.Start()
end
elseif (labelName == "Bank") then
Walker.Stop()
wait(800,1400)
Self.SayToNpc("hi")
wait(800,1400)
Self.SayToNpc("deposit all")
wait(800,1400)
Self.SayToNpc("yes")
wait(1800,2400)
Self.WithdrawMoney((50*(MPBuy-Self.ItemCount(ManaPots)))+50)
wait(800,1400)
Self.SayToNpc("yes")
wait(100,400)
wait(800,1400)
Self.WithdrawMoney((45*(HPBuy-Self.ItemCount(HealthPots)))+50)
wait(800,1400)
Self.SayToNpc("yes")
wait(800,1400)
Self.SayToNpc("balance")
Targeting.Start()
Walker.Start()
elseif (labelName == "pots") then
Walker.Stop()
wait(2500,3000)
Self.SayToNpc({"Hi", "Vial", "yes", "trade"}, 80)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Walker.Start()
end
-----
Self.ReachDepot = function (tries)
local tries = tries or 3
Walker.Stop()
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end
local function gotoDepot()
local pos = Self.Position()
print("Depots found: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
Walker.Start()
return true
end
else
print("Something is blocking the path. Trying next depot.")
end
end
return false
end
repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
until tries <= 0
return false
end
Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
return store
end
function Self.WithdrawItems2(slot, ...)
local function withdrawFromChildContainers(items, parent, slot)
local bid = parent:GetItemData(slot).id
if (#items > 0) and (Item.isContainer(bid)) then
parent:UseItem(slot, true) -- open backpack on the slot
else
return true
end
wait(500, 900)
local child = Container.GetLast() -- get the child opened backpack
if (child:ID() == bid) then -- the child bp id matches the itemid clicked, close enough
local childCount = child:ItemCount()
local offset = 0
local count = {}
for spot = 0, childCount - 1 do -- loop through all the items in depot backpack
local item = child:GetItemData(spot - offset)
local data, index = table.contains(items, item.id, 1)--, table.find(items, item.id)
if (data) then
if (not count[item.id]) then count[item.id] = 0 end -- start the count
local DestinationBp = Container.GetByName(AmmoBP)
local dest = DestinationBp
local skip = false
local toMove = item.count -- we think we're going to move all the item at first, this may change below
local slotnum = tonumber(data[2])
if (slotnum) then
slot = slotnum
end
toMove = math.min(data[3] - count[item.id], item.count) -- get what's left to withdraw or all of the item, whichever is least
if((count[item.id] + toMove) > data[3])then -- this is probably not needed, but just incase we are trying to move more than the limit
skip = true -- skip the entire moving
table.remove(items, index) -- remove the item from the list
end
if not (skip) then
local compCount = child:CountItemsOfID(item.id)
wait(500, 900)
if(compCount > child:CountItemsOfID(item.id))then -- less of the itemid in there now, item moved successfully.. most likely.
count[item.id] = count[item.id] + toMove
if(toMove == item.count)then -- if we deposited a full item stack then decrease the offset, if not remove the item since we're done.
offset = offset + 1
else
table.remove(items, index)
end
else
return true -- we didn't move the item, container is full. TODO: recurse the player containers.
end
end
end
end
return withdrawFromChildContainers(items, child, child:ItemCount() - 1)
end
return false
end
setBotEnabled(false) -- turn off walker/looter/targeter
local depot = Self.OpenDepot()
if (depot) then -- did we open depot?
local items = {}
for i = 1, #arg do
local data = arg[i]
items[i] = {Item.GetItemIDFromDualInput(data[1]), data[2], data[3]}
end
withdrawFromChildContainers(items, depot, slot)
end
setBotEnabled(true)
delayWalker(2500)
end
end
using nixez venore rotworms script everything looks right to what ive been reading must be missing something silly.
i have a normal bp as my main backpack and 4 golden backpacks stacked inside eachother inside that main bp, when it does "resetting bp's" it opens it up so i know it detects it, but it fails to put gold coins in there.
--- MISC Info
--- Your #1 BP inside depot will recieve stackables.
--- Your #2 BP inside depot will recieve non-stackables.
-----------------------------------------------------------------------------------------------------------------------
--- BP Settings ---
local GoldBP = "Golden Backpack" --- Your gold backpack (use same colors inside)
-----------------------------------------------------------------------------------------------------------------------
--- Hunt Settings ---
local CapLeave = 10 --- Leave spawn if cap is below this.
--Potions Setup
local MPBuy = 15 --- Amount of mana pots to bring on hunt.
local MPLeave = 10 --- Leave spawn if mana potions is below this.
local ManaPots = 268 --- ID of your manapots.
local HealthPots = 266 ----Id Of Your healthpots.
local HPBuy = 5 -- Amount of health pots to bring on hunt.
local HpLeave = 1 --- Leave spawn if mana potions is below this.
---Paladin Options----
local AmmoID = 7378 ---Id of Ammo To refill <<Royal spear 7378>>>
local MaxAmmo = 10 --------How many ammo you wanna withdraw from depot
local AmmoDP = 2 -- Slot of DP that will be for your ammunition. 0 is first backpack 1 is second backpack 2 is third backpack ETC
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
print([[
------Venore East rotworms[Knight]----
----This script was created by:----
----------------Nixez-------------
----------Happy Hunting!-----------
-----------------------------------]])
wait(7000)
function onWalkerSelectLabel(labelName)
if (labelName == "suppcheck") then
if (Self.ItemCount(HealthPots) < HpLeave) then
Walker.Goto("Leavecave")
print([[Low Health pots.]])
elseif (Self.ItemCount(ManaPots) < MPLeave) then
Walker.Goto("Leavecave")
print([[Low mana pots, Going Refill ]])
else
Walker.Goto("start")
print([[Enough supplies & cap.]])
end
elseif (labelName == "BP") then
Walker.Stop()
print([[Resetting BP..]])
wait(1000,2000)
Self.CloseContainers()
wait(2000,3000)
Self.OpenMainBackpack(true):OpenChildren({Item.Get ID(GoldBP), true})
wait(2000,3000)
Walker.Start()
elseif (labelName == "deposit") then
Walker.Stop()
wait(1600,2400)
Self.DepositItems({9689, 0}, {8031, 0}, {10275, 0}, {9692, 0}, {5894, 0})
wait(500,1500)
Self.DepositItems({11485, 0}, {12600, 0}, {10276, 0})
if (Self.Stamina() < 960) then
Walker.Stop()
else
Walker.Start()
end
elseif (labelName == "Bank") then
Walker.Stop()
wait(800,1400)
Self.SayToNpc("hi")
wait(800,1400)
Self.SayToNpc("deposit all")
wait(800,1400)
Self.SayToNpc("yes")
wait(1800,2400)
Self.WithdrawMoney((50*(MPBuy-Self.ItemCount(ManaPots)))+50)
wait(800,1400)
Self.SayToNpc("yes")
wait(100,400)
wait(800,1400)
Self.WithdrawMoney((45*(HPBuy-Self.ItemCount(HealthPots)))+50)
wait(800,1400)
Self.SayToNpc("yes")
wait(800,1400)
Self.SayToNpc("balance")
Targeting.Start()
Walker.Start()
elseif (labelName == "pots") then
Walker.Stop()
wait(2500,3000)
Self.SayToNpc({"Hi", "Vial", "yes", "trade"}, 80)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(800,1740)
Self.ShopBuyItemsUpTo(ManaPots, MPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Self.ShopBuyItemsUpTo(HealthPots, HPBuy)
wait(2500,3000)
Walker.Start()
end
-----
Self.ReachDepot = function (tries)
local tries = tries or 3
Walker.Stop()
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end
local function gotoDepot()
local pos = Self.Position()
print("Depots found: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
Walker.Start()
return true
end
else
print("Something is blocking the path. Trying next depot.")
end
end
return false
end
repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
until tries <= 0
return false
end
Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
return store
end
function Self.WithdrawItems2(slot, ...)
local function withdrawFromChildContainers(items, parent, slot)
local bid = parent:GetItemData(slot).id
if (#items > 0) and (Item.isContainer(bid)) then
parent:UseItem(slot, true) -- open backpack on the slot
else
return true
end
wait(500, 900)
local child = Container.GetLast() -- get the child opened backpack
if (child:ID() == bid) then -- the child bp id matches the itemid clicked, close enough
local childCount = child:ItemCount()
local offset = 0
local count = {}
for spot = 0, childCount - 1 do -- loop through all the items in depot backpack
local item = child:GetItemData(spot - offset)
local data, index = table.contains(items, item.id, 1)--, table.find(items, item.id)
if (data) then
if (not count[item.id]) then count[item.id] = 0 end -- start the count
local DestinationBp = Container.GetByName(AmmoBP)
local dest = DestinationBp
local skip = false
local toMove = item.count -- we think we're going to move all the item at first, this may change below
local slotnum = tonumber(data[2])
if (slotnum) then
slot = slotnum
end
toMove = math.min(data[3] - count[item.id], item.count) -- get what's left to withdraw or all of the item, whichever is least
if((count[item.id] + toMove) > data[3])then -- this is probably not needed, but just incase we are trying to move more than the limit
skip = true -- skip the entire moving
table.remove(items, index) -- remove the item from the list
end
if not (skip) then
local compCount = child:CountItemsOfID(item.id)
wait(500, 900)
if(compCount > child:CountItemsOfID(item.id))then -- less of the itemid in there now, item moved successfully.. most likely.
count[item.id] = count[item.id] + toMove
if(toMove == item.count)then -- if we deposited a full item stack then decrease the offset, if not remove the item since we're done.
offset = offset + 1
else
table.remove(items, index)
end
else
return true -- we didn't move the item, container is full. TODO: recurse the player containers.
end
end
end
end
return withdrawFromChildContainers(items, child, child:ItemCount() - 1)
end
return false
end
setBotEnabled(false) -- turn off walker/looter/targeter
local depot = Self.OpenDepot()
if (depot) then -- did we open depot?
local items = {}
for i = 1, #arg do
local data = arg[i]
items[i] = {Item.GetItemIDFromDualInput(data[1]), data[2], data[3]}
end
withdrawFromChildContainers(items, depot, slot)
end
setBotEnabled(true)
delayWalker(2500)
end
end