SRL Archive - SRL Snippets

shopScreen


Element17

2014-07-23 15:53:01

I wrote this function to determine if a shop's screen was open. I didn't see anywhere in the include that this was already done. I'm not sure how well it works. It gets the job done for me.



function shopScreen(Wait: integer = 0): boolean;
var
t: integer;
b: TBox;
TPA: TPointArray;
begin
if not isLoggedIn() then
exit;
t := (getSystemTime() + Wait);
repeat
b := IntToBox(520, 39, 532, 51); //may add another check
if findColorsTolerance(TPA, 1072344, b, 24, colorSetting(2, 0.24, 0.53)) then // red box top right
writeln('Shopscreen is open');
result := true;
exit;
until (getSystemTime() >= t);
end;

Ashaman88

2014-07-23 16:18:57

What does the shopscreen look like :)

Element17

2014-07-24 14:56:22

From: Ashaman88
What does the shopscreen look like :)


http://img4.wikia.nocookie.net/__cb20140128211242/runescape/images/thumb/e/e5/Brian%27s_Battleaxe_Bazaar_stock.png/180px-Brian%27s_Battleaxe_Bazaar_stock.png

Turpinator

2014-07-24 15:07:33

From: Element17
http://img4.wikia.nocookie.net/__cb20140128211242/runescape/images/thumb/e/e5/Brian%27s_Battleaxe_Bazaar_stock.png/180px-Brian%27s_Battleaxe_Bazaar_stock.png


Element17

2014-07-24 15:15:10

Oh my that is small.

Try this one.

[ATTACH=CONFIG]23651[/ATTACH]

Ashaman88

2014-07-24 15:20:17

From: Element17
Oh my that is small.

Try this one.

[ATTACH=CONFIG]23651[/ATTACH]



Element17

2014-07-24 15:20:28

Oh my that is small.

Try this one.

[ATTACH=CONFIG]23652[/ATTACH]

Ashaman88

2014-07-24 15:21:18

From: Element17
Oh my that is small.

Try this one.

[ATTACH=CONFIG]23652[/ATTACH]



I see I see, cool thanks!

Element17

2014-07-24 15:30:09

Yeah no problem! It should work for any shop in Runescape.

Turpinator

2014-07-24 16:55:57

From: Element17
Oh my that is small.

Try this one.

[ATTACH=CONFIG]23652[/ATTACH]


i was expecting a small one again…

Element17

2014-07-24 18:09:38

From: Turpinator
i was expecting a small one again…


Haha well sorry to disappoint.

KeepBotting

2014-08-06 12:18:33

LOL this thread made me laugh, and has a great snippet in it as well :)

Incurable

2014-08-13 00:27:33

From: Element17
Haha well sorry to disappoint.


I was actually incredibly disappointed, I laughed so hard when I saw the second small image and the same reply from Ashaman. XD

HKbotz

2015-01-10 20:14:09

Nice, saves me from having to make one :)
Had to change it slightly though.


repeat
b := IntToBox(520, 39, 532, 51); //may add another check
if findColorsTolerance(TPA, 1072344, b, 24, colorSetting(2, 0.24, 0.53)) then // red box top right
begin //added begin and end because it was just executing the writeln() part if it was true, but the rest would always execute making it always exit true without wait.
writeln('Shopscreen is open');
exit(true); //shorter, just saves a line, no real difference.
end;
until (getSystemTime() >= t);