lassan
04-02-2013, 07:26 PM
Hello!
I was planning on hunting some dwarf guards but i've run into abit of a problem..
I want the bot to hunt dwarfguards as normal, kill & loot. I then want it to drop the heavier loot such as scale armor, steel helmet and so on at a certain place in the cave and what i've come up with is this script, i took another "drop x" script and modified it abit.
I'm Newb at this sort of thing so havnt got the slightest idea of if this is the right way to do it..
Any help is much appreciated!
Node
Node
Stand at x coord - Drop all loot on ground on same coord
Node
Node
Node
-- SETTING -------------------------------------------
-----------------------------------------------------
ManaType = 3031, 3377 -- 3031/gold, 3377/scale arm and so on.
ManasToDrop = 5 -- How many empty vials before drop?
-----------------------------------------------------
-- END OF SETTING--------------------------------------
function dropItem(id, cnt)
local cont = Container.GetFirst()
while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == id and item.count >= cnt) then
cont:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z)
return true
end
end
cont = cont:GetNext()
end
return false
end
while (true) do
if (dropItem(ManaType,ManasToDrop)) then
wait(1000, 4000) --Since we've already dropped a stack, wait a bit of time before trying to drop another
else
wait(2000) --havent dropped shit, wait2 seconds and try again. No need for randomization since we didn't do anything
end
end
I was planning on hunting some dwarf guards but i've run into abit of a problem..
I want the bot to hunt dwarfguards as normal, kill & loot. I then want it to drop the heavier loot such as scale armor, steel helmet and so on at a certain place in the cave and what i've come up with is this script, i took another "drop x" script and modified it abit.
I'm Newb at this sort of thing so havnt got the slightest idea of if this is the right way to do it..
Any help is much appreciated!
Node
Node
Stand at x coord - Drop all loot on ground on same coord
Node
Node
Node
-- SETTING -------------------------------------------
-----------------------------------------------------
ManaType = 3031, 3377 -- 3031/gold, 3377/scale arm and so on.
ManasToDrop = 5 -- How many empty vials before drop?
-----------------------------------------------------
-- END OF SETTING--------------------------------------
function dropItem(id, cnt)
local cont = Container.GetFirst()
while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == id and item.count >= cnt) then
cont:MoveItemToGround(spot, Self.Position().x, Self.Position().y, Self.Position().z)
return true
end
end
cont = cont:GetNext()
end
return false
end
while (true) do
if (dropItem(ManaType,ManasToDrop)) then
wait(1000, 4000) --Since we've already dropped a stack, wait a bit of time before trying to drop another
else
wait(2000) --havent dropped shit, wait2 seconds and try again. No need for randomization since we didn't do anything
end
end