PDA

View Full Version : Depositer not depositing properly!



Beo
07-28-2013, 08:36 AM
Hi,
This is my problem;

I have 2 backpacks of medicine pouches, last backpack deposits, backpack resets, goes back to first backpack which is full, then goes to hunt.

http://1.imgland.net/gf--Cm.png (http://1.imgland.net/gf--Cm.png)


I'm not really sure how to explain it, lol.

If I have 3 backpacks, I go to hunt with them all empty, when they are all full and my character deposits, it only deposits the backpack that was currently open while hunting (the previous ones do not get deposited) so I go back to hunt with 2 backpacks full of items still.

Cheers.

XtrmJosh
07-28-2013, 08:42 AM
Hi,
This is my problem;

I have 2 backpacks of medicine pouches, last backpack deposits, backpack resets, goes back to first backpack which is full, then goes to hunt.

http://1.imgland.net/gf--Cm.png (http://1.imgland.net/gf--Cm.png)


I'm not really sure how to explain it, lol.

If I have 3 backpacks, I go to hunt with them all empty, when they are all full and my character deposits, it only deposits the backpack that was currently open while hunting (the previous ones do not get deposited) so I go back to hunt with 2 backpacks full of items still.

Cheers.

If you are good with lua you can convert this pseudocode into actual code:

local lootbackpacks = 3

for i = 0, lootbackpacks, 1 do
DepositItems(~~)
OpenNextContainer()
end

Beo
07-28-2013, 08:46 AM
If you are good with lua you can convert this pseudocode into actual code:

local lootbackpacks = 3

for i = 0, lootbackpacks, 1 do
DepositItems(~~)
OpenNextContainer()
end

I know basic LUA, don't know what this shizzle is xd

XtrmJosh
07-28-2013, 10:45 AM
I know basic LUA, don't know what this shizzle is xd

Allow me to explain a little. What you're trying to do is make the bot perform an action similar to this:

Deposit items in current container
Switch to next container which contains items
Deposit items in current container
Switch to next container which contains items

Repeatedly. Whenever you are trying to do something repetitive, you can do it far simpler by looping, so you can use a for loop like that I listed:

for i = 0, lootbackpacks, 1 do

This line takes a variable (i), and declares it to be 0. It then takes a maximum value (lootbackpacks, declared previously as 3), and an increment value (1). It takes i, adds the increment value (1) to it, and if i is less than lootbackpacks, it will perform the code between the "do" and "end". In this instance it will repeat the loop 3 times, meaning once for each lootbackpack (hence the named variable).

The best way to implement this would be to reset your loot backpack so it is at the first container full of items, then run this code. You'd need a function for OpenNextContainer to open the next container in the loot backpack, and DepositItems could be either a function or just use the default function, your decision.

For the record, most people here would consider this to be "basic lua", it's a very generic programming method, and in C# it would look very similar:


for (int i = 0; i < lootbackpacks; i++)
{
// Run code here
}

Beo
07-28-2013, 12:50 PM
I guess I don't know basic lua then. xd

But thank you