PDA

View Full Version : Put supplies into SuppliesBP once it have bought the supplies.



DarkRoses
06-15-2013, 12:58 AM
How do I make this happend on a specific Label. Lets say I have put my WP like this:

BuySupplies
SuppliesToSuppBP <- Is where it should move the items after it bought the supplies.

Kociii
06-15-2013, 12:59 AM
Look here..

http://forums.xenobot.net/showthread.php?14711-Put-Bolts-In-Bp-3

DarkRoses
06-15-2013, 01:03 AM
Look here..

http://forums.xenobot.net/showthread.php?14711-Put-Bolts-In-Bp-3
Thanks! :) Didn't find this when I searched :p

Kociii
06-15-2013, 01:07 AM
It's ok ;)

DarkRoses
06-15-2013, 10:53 AM
This is not working.
I get this error: Error: attempt to call method 'ItemCount' (a nil value)
How do I fix it?

dinmamma
06-15-2013, 11:04 AM
This is not working.
I get this error: Error: attempt to call method 'ItemCount' (a nil value)
How do I fix it?

Could you post which one you were trying to use?

There are 2 different versions in that thread.

DarkRoses
06-15-2013, 12:10 PM
Walker.Stop()
while (true) do
if Self.ItemCount(3155) >= 1 then
local MainBp = Container.GetByName(MainBP)
local DestinationBp = Container.GetByName(SuppBP)
for spot = 0, MainBp:ItemCount() do
local item = MainBp:GetItemData(spot)
if (item.id == 3155) then
MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
wait(500)
break
end
end
end
wait(200)
end
Walker.Start()

Kociii
06-15-2013, 12:20 PM
Walker.Stop()
while (true) do
if Self.ItemCount(3155) >= 1 then
local MainBp = Container.GetByName(MainBP)
local DestinationBp = Container.GetByName(SuppBP)
for spot = 0, MainBp:ItemCount() do
local item = MainBp:GetItemData(spot)
if (item.id == 3155) then
MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
wait(500)
break
end
end
end
wait(200)
end
Walker.Start()

use the other one -.-

DarkRoses
06-15-2013, 12:53 PM
use the other one -.-
With the other one I get this error:
Error: attempt to call method 'CountItemsOfID' (a nil value)

DarkRoses
06-15-2013, 01:47 PM
Nevermind, I fixed it. Thanks for the help anyways:)