SCAR Code:
program AQWorldsOwner;
{.include SRL/SRL.scar}
{.plugin Plugins/Appa.dll}
const
//----------setup----------//
Username = '';
Password = '';
//----------endof----------//
var
t: Integer;
x, y: Integer;
function appa_NavigateTo(URL: string; TimeOut: Integer): Boolean;
var
t: Integer;
begin
Result := False;
if (not appa_Showing) then
Exit;
if (URL <> '') then
appa_Navigate(URL);
t := GetSystemTime + TimeOut;
while (not appa_PageLoaded) and appa_Showing and (GetSystemTime < t) do
Wait(250);
Result := appa_PageState >= 3;
end;
procedure LoadAQ;
begin
appa_ShowForm; //Show the form
appa_NavigateTo('', 10000); //Wait until it's fully loaded
appa_NavigateTo('http://aqworlds.battleon.com/game/default.asp?size=tiny', 10000); //Navigate to aqworlds.com
end;
procedure LogMeInUser;
var
x, y: Integer;
begin
if (not(FindColor(x, y, 16777215, 295, 178, 451, 190))) then
Exit;
if FindColor(x, y, 16777215, 295, 178, 451, 190) then
begin
appa_MoveMouse(x, y);
wait(100);
appa_HoldMouse(x, y, true);
wait(30);
appa_ReleaseMouse(x - 150, y, true);
wait(1000);
TypeSend(Username);
wait(1000);
end;
end;
procedure LogMeInPass;
var
x, y: Integer;
begin
if (not(FindColor(x, y, 16777215, 295, 206, 451, 217))) then
Exit;
if FindColor(x, y, 16777215, 295, 206, 451, 217) then
begin
appa_MoveMouse(x, y);
wait(100);
appa_HoldMouse(x, y, true);
wait(30);
appa_ReleaseMouse(x - 150, y, true);
wait(1000);
TypeSend(Password);
wait(1000);
end;
end;
procedure LogMeInButton;
var
x, y: Integer;
begin
{if (not(FindColor(x, y, 2045101, 395, 252, 410, 260))) then
Exit;
if FindColor(x, y, 2045101, 395, 252, 410, 260) then
begin
if (not(FindBitmap(LoginDTM, x, y))) then
Exit;
if FindBitmap(LoginDTM, x, y) then
begin
appa_MoveMouse(x, y);
wait(100);
appa_HoldMouse(x, y, true);
wait(30);
appa_ReleaseMouse(x, y, true);
wait(4000);
end;}
appa_MoveMouse(373, 258);
wait(100);
appa_HoldMouse(373, 258, true);
wait(30);
appa_ReleaseMouse(373, 258, true);
wait(4000);
end;
procedure ChooseServer;
begin
appa_MoveMouse(255, 195);
wait(100);
appa_HoldMouse(255, 195, true);
wait(30);
appa_ReleaseMouse(255, 195, true);
wait(10000);
end;
procedure AQWLogin;
begin
LogMeInUser;
LogMeInPass;
LogMeInButton;
ChooseServer;
end;
procedure MapToLolosia;
begin
appa_MoveMouse(544, 383);
wait(100);
appa_HoldMouse(544, 383, true);
wait(30);
appa_ReleaseMouse(544, 383, true);
wait(3000);
appa_MoveMouse(504, 183);
wait(100);
appa_HoldMouse(504, 183, true);
wait(30);
appa_ReleaseMouse(504, 183, true);
wait(2000);
appa_MoveMouse(578, 296);
wait(100);
appa_HoldMouse(578, 296, true);
wait(30);
appa_ReleaseMouse(578, 296, true);
wait(10000);
end;
procedure FightTheFish;
var
x, y: Integer;
begin
if (not(FindColor(x, y, 2045101, 395, 252, 410, 260))) then
repeat
FindColor(x, y, 2045101, 395, 252, 410, 260);
wait(250);
until(FindColor(x, y, 2045101, 395, 252, 410, 260));
appa_MoveMouse(x, y);
wait(100);
appa_HoldMouse(x, y, true);
wait(30);
appa_ReleaseMouse(x, y, true);
wait(20000);
end;
end;
procedure RestUp;
begin
appa_MoveMouse(526, 382);
wait(100);
appa_HoldMouse(526, 382, true);
wait(30);
appa_ReleaseMouse(526, 382, true);
wait(10000);
end;
begin
LoadAQ;
LoadBitmaps;
AQWLogin;
MapToLolosia;
repeat
FightTheFish;
RestUp;
until(IsFKeyDown(12));
end.