SRL Archive - Help and Support

Retrieving shop item amounts.


Wanted

2009-07-26 07:08:20

Does anyone know a working way of find the amount of a stacked item in a shop?

Amount.SCAR does not work.

Uses for reflection and color would be appreciated.

Thanks,

-Ice

Method

2009-07-26 07:28:52

Shops function like the bank, from what I remember, so you should be able to use the same methods of getting item IDs and stacks that Bank.scar does, except with different interfaces.

With color you probably would have to use a GetNumbers or something like that. I haven't scripted for a long time, so I'm not sure.

Wanted

2009-07-26 07:34:29

What interface would a general store and a ranger store in Varrock be?

I think I might need StrToIntDef(FindText, -1) or something for the amount.

Method

2009-07-26 07:39:52

RSBot's svn says it's the children of interface 620, child 24, so try that.

Naum

2009-07-26 11:20:19

Ice, you might have to make a tbox around the item, then use findcolor to get the exact position of the text cordinates, then use gettextatex :)

ShowerThoughts

2009-07-26 13:18:16

Amount.scar must work!
Try it with a dtm?

Naike

2009-07-26 22:51:37

Use misc/buysell.scar with GetAmount from Amount.scar

and you got your finding ;)

Wanted

2009-07-27 05:41:56

From: N1ke!
Use misc/buysell.scar with GetAmount from Amount.scar

and you got your finding ;)


var
SMLB: TPoint;
begin
SetUpSRL;
Wait(1000 + Random(1000));
WriteLn(BoolToStr(ShopScreen));
SMLB := ShopItemCoords(2);
WriteLn(IntToStr(SMLB.X) + ', ' + IntToStr(SMLB.Y));
WriteLn(IntToStr(GetAmount(SMLB.X, SMLB.Y)));

ShopItemCoords works, but GetAmount returns 0 or 1 for 0, and infinite, and it also returns only the furthest right digit of 2 or more digited numbers.

Anyone want to help me fix GetAmount or come up with another way?

Haven't tested reflection yet, doing that now.

Edit: ShopItemCoords only works for the first two rows:

{.Include SRL\SRL.SCAR}
{.Include SRL\SRL\Misc\BuySell.SCAR}

var
I: Byte;
P: TPoint;

begin
SetUpSRL;
for I := 1 to 50 do
begin
P := ShopItemCoords(I);
MMouse(P.X, P.Y, 2, 2);
Wait(1000 + Random(500));
end;
end.

Edit: Actually ShopItemCoords works fine.

GetAmount is skipping the first digit though.

Naike

2009-07-29 03:07:14

I've now updated GetAmount to work again, enjoy :)

mormonman

2009-07-29 03:21:08

From: N1ke!
I've now updated GetAmount to work again, enjoy :)


wb from ur dad's xD

Wanted

2009-07-29 04:56:43

yay for N1ke!

I made a CoinAmountEx for anyone that wants to use:

http://www.villavu.com/forum/showthread.php?t=48320

Now all I need to do is make a GetAmountEx that examines any item…