SCAR Code:
program BeerBuyer;
{.include SRL/SRL.scar}
const
typeOfBeer=0; //0 for asgarian ale, 1 for wizard's mind bomb, 2 for dwarven stout
Function AskForBeer: Boolean;
var
x, y: integer;
begin
x:=0;
if FindColorTolerance(x,y,1486254, 0, 0, 800, 540,15) then
begin
Writeln('1a');
wait(random(100));
Mouse(x,y,3,3,True);
Writeln('1b');
if FindColorTolerance(x,y,16711680, 0, 540, 800, 650,15) then
begin
Writeln('2');
wait(50+random(50));
Mouse(x,y,3,3,True);
if FindColorTolerance(x,y,16711680, 0, 540, 800, 650,15) then
begin
Writeln('3');
wait(50+random(50));
Mouse(x,y,3,3,True);
if FindColorTolerance(x,y,16711680, 0, 540, 800, 650,15) then
begin
Writeln('4');
wait(50+random(50));
Mouse(x,y,3,3,True);
result:= True;
end;
end;
end;
end;
end;
Procedure BuyBeer;
var
x,y: integer;
begin
if (typeOfBeer = 0) then Mouse(483, 582, 10,2,True);
if (typeOfBeer=1) then Mouse(483, 601, 10,2,True);
if (typeOfBeer=2) then Mouse(483, 623, 10,2,True);
if FindColorTolerance(x,y,16711680, 0, 540, 800, 650,15) then
begin
wait(50+random(50));
Mouse(x,y,3,3,True);
end;
end;
begin //mainloop
repeat
//if AskForBeer then BuyBeer;
Writeln('0');
AskForBeer;
until(false)
end.