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;