SRL Archive - RS3 Help

Waiting until certain inventory conditions are met


FooJoo

2015-03-25 08:52:40

Hi all,

I am in process of making a script that makes potions. I've got the basic functionality and it works but before I go onto improving the script I'm just trying to iron out the current bugs and issue first.

Anyway here is a snippet below which I could do with some advice with:

procedure makePotions();
begin
if not isLoggedIn() then
exit();

if not productionScreen.isOpen() then
begin
tabBackpack.clickDTM(HerbDTM, MOUSE_LEFT, '', 300, false);
tabBackpack.clickDTM(VialOfWaterDTM, MOUSE_LEFT, '', 300, false);
repeat
wait(randomRange(100, 200));
until productionScreen.isOpen();
end;

productionScreen.clickStart();
repeat
wait(randomRange(1000, 2000));
until tabBackpack.countDTM(VialOfWaterDTM) = 0
end;

As we can see it will wait until there is no more water vials left in the inventory before continuing. However I have noticed some possible issues that could arise from here. Sometimes the hover text is over the inventory which means it cannot count properly sometimes. Also the DTM finding isn't all that reliable sometimes.

My main question is - does anyone know how I could program a more reliable way to check if the potions are made and to continue.

EDIT: Here's a screenshot of what I'm talking about when the hover text gets in the way:

[ATTACH=CONFIG]25393[/ATTACH]

Thanks in advance!

loginor

2015-03-25 09:26:00

Maybe you could add a random which moves the mouse to somewhere but not the iventory? Could work as an antiban also.

FooJoo

2015-03-25 09:29:55

From: loginor
Maybe you could add a random which moves the mouse to somewhere but not the iventory? Could work as an antiban also.


Yeah I thought about that, it's a very viable option and most likely what I will do :) Just also wondering if there is a way I can cut out the DTM method all together really.

loginor

2015-03-25 09:45:16

If you use preset withdraw, then you could just randomly click slot 1-14 and 15-28 from your backpack. Im sure there is somethign in srl6 for this ,im just at work and cant check now. ALso I am a newbie really, just trying to help.

EDIT:

if not productionScreen.isOpen() then
begin
tabBackpack.mouseSlot(randomRange(1, 14), MOUSE_LEFT);
wait(randomRange(800,1600));
tabBackpack.mouseSlot(randomRange(15, 28), MOUSE_LEFT);
end;

fady

2015-03-25 10:12:26

From: Zallen93
Hi all,

I am in process of making a script that makes potions. I've got the basic functionality and it works but before I go onto improving the script I'm just trying to iron out the current bugs and issue first.

Anyway here is a snippet below which I could do with some advice with:

procedure makePotions();
begin
if not isLoggedIn() then
exit();

if not productionScreen.isOpen() then
begin
tabBackpack.clickDTM(HerbDTM, MOUSE_LEFT, '', 300, false);
tabBackpack.clickDTM(VialOfWaterDTM, MOUSE_LEFT, '', 300, false);
repeat
wait(randomRange(100, 200));
until productionScreen.isOpen();
end;

productionScreen.clickStart();
repeat
wait(randomRange(1000, 2000));
until tabBackpack.countDTM(VialOfWaterDTM) = 0
end;

As we can see it will wait until there is no more water vials left in the inventory before continuing. However I have noticed some possible issues that could arise from here. Sometimes the hover text is over the inventory which means it cannot count properly sometimes. Also the DTM finding isn't all that reliable sometimes.

My main question is - does anyone know how I could program a more reliable way to check if the potions are made and to continue.

EDIT: Here's a screenshot of what I'm talking about when the hover text gets in the way:

[ATTACH=CONFIG]25393[/ATTACH]

Thanks in advance!


I'm not sure if this process has a progress screen or not (I've never been p2p) but if it does, you can use:

until not (progressScreen.isOpen());

or do you want to specifically use inventory counts?

EDIT: you can also do:
until not (tabBackpack.isItemInSlot(28)); or which ever the last filled spot would be on your preset withdrawl.

FooJoo

2015-03-25 10:12:44

From: loginor
If you use preset withdraw, then you could just randomly click slot 1-14 and 15-28 from your backpack. Im sure there is somethign in srl6 for this ,im just at work and cant check now. ALso I am a newbie really, just trying to help.

EDIT:

if not productionScreen.isOpen() then
begin
tabBackpack.mouseSlot(randomRange(1, 14), MOUSE_LEFT);
wait(randomRange(800,1600));
tabBackpack.mouseSlot(randomRange(15, 28), MOUSE_LEFT);
end;


Thank you, +rep :)

From: fady
I'm not sure if this process has a progress screen or not (I've never been p2p) but if it does, you can use:

until not (progressScreen.isOpen());

or do you want to specifically use inventory counts?


Oh damn, I never even thought of that! I have it turned off normally. That will do perfect :)