The code below is made for a game called Evony. It is supposed to check for two permanent areas of white color to decide whether an account is logged in or not and then from there it is either supposed to Log in and then change "LoggedIn" to true or if its already logged in it should just change the value to true. It also writes in the debug box about whether or not it successfully logged in.
My problem is whenever I run this procedure it always returns "LoggedIn" as false and ignores the color checks.
procedure Login;
var
LoggedIn: Boolean;
m, n: Integer;
EmailAddress, Password: String;
begin
EmailAddress:=('fake@yahoo.com')
Password:=('fake')
if FindColor(m, n, 16777215, 58, 319, 76, 335) then
begin
LoggedIn:=False;
wait(100)
ClickWindMouse(475, 389, 121, 10, true);
wait(350+random(500))
sendkeys(EmailAddress);
wait(350+random(500))
ClickWindMouse(475, 415, 121, 10, true);
wait(350+random(500))
sendkeys(Password);
wait(350+random(500))
ClickWindMouse(431, 487, 156, 20, true);
repeat
wait(500)
until FindColor(m, n, 16777215, 378, 529, 478, 538)
LoggedIn:=True;
end else
if FindColor(m, n, 16777215, 378, 529, 478, 538) then
begin
LoggedIn:=True;
end else
begin
LoggedIn:=False;
end;
if LoggedIn=True then
begin
writeln('We Have Successfully Logged In');
end else
begin
writeln('Failed To Login - Terminating Script');
end;
end;
EDIT: Figured out my coordinates were off so it wasn't seeing the colors I told it to look for, booleans worked flawlessly.