Simba Code:
program Replay;
var
Vmana, NetworkScreen, NetworkYes, OKbutton, Restartbutton, StartBattleScreen, NoMon1,
x, y, Battlebutton, NoMon2, NoMon3, NoMon4, NoMon5:integer;
nextround, clicked, Mon1, Mon2, Mon3, Mon4, Mon5:boolean;
Procedure MonsterCheck;
begin
NoMon1 := DTMFromString('m6wAAAHic42ZgYKhnYmCQAtLdQPo5CwPDEyCuA7KFgWIXgHgWEL8G4jNA/BWIfYDYDYi9QHKMDAxzgXgaEO8B8vcB8W4gPgDEvT1VDJOLzBjaM10YVnWHMHgYyzJUJrky9OaaM/z79w+OfU1FGPABLjTMSAJGAgAxQB98');
NoMon2 := DTMFromString('mPwEAAHic42dgYKhjYmAoBeJyIBYA8t+xMDCIAunnQPoJEEsA2eaMDAyBQOwMxC5AbAvE3kD8BSjnDsTzgewHQPo9EPsAsTcQTwOKTQXio0D2ESDeBcQrgHglEC8D4p7+WoaSKCuGomBThuZUV4bufD+GQwsTgTiJYcOECIYtU8IY4rz0GGK99RicjBUYoj20wTQIMwP1k4sZKcBoAADozyEK');
NoMon3 := DTMFromString('mPwEAAHic42dgYKhjYmAoBeJyIBYA8t+xMDCIAunnQPoJEEsA2bsYGRguA/FRID4GxAeA+CIQfwHKuQPxfCD7AZB+D8Q+QOwNxNOAYlOB+BADBG8H4qVAvBKKe/prGUqirBiKgk0ZmlNdGbrz/RgOLUwE4iSGDRMiGLZMCWOI89JjiPXWY3AyVmCI9tAG0yDMDNRPLmakAKMBABwBJBQ=');
NoMon4 := DTMFromString('mPwEAAHic42dgYKhjYmAoBeJyIBYA8t+xMDCIAunnQPoJEEsA2V+AWICRgYEJiFmA+A+Qz80IEXcH4vlA9gMg/R6IfYDYG4inAcWmArEvEPsBsT0QGwOxCRCbA3FPfy1DSZQVQ1GwKUNzqitDd74fw6GFiUCcxLBhQgTDlilhDHFeegyx3noMTsYKDNEe2mAahJmB5pOLGSnAaAAALsgexg==');
NoMon5 := DTMFromString('mPwEAAHic42dgYKhjYmAoBeJyIBYA8t+xMDCIAunnQPoJEEsA2VWMDAyTgLgNiFuBuA6Ie4H4C1DOHYjnA9kPgPR7IPYBYm8gngYUmwrEgUDsB8T2QGwIxGZQ3NNfy1ASZcVQFGzK0JzqytCd78dwaGEiECcxbJgQwbBlShhDnJceQ6y3HoOTsQJDtIc2mAZhZqD55GJGCjAaAABOmx/c');
If not (FindDTM(NoMon1, x, y, 0, 0, 1200, 700)) Then
Wait(100);
Mon1:=true;
Wait(100);
If not (FindDTM(NoMon2, x, y, 0, 0, 1200, 700)) Then;
Wait(100);
Mon2:=true;
Wait(100);
If not (FindDTM(NoMon3, x, y, 0, 0, 1200, 700)) Then;
Wait(100);
Mon3:=true;
Wait(100);
If not (FindDTM(NoMon4, x, y, 0, 0, 1200, 700)) Then;
Wait(100);
Mon4:=true;
Wait(100);
If not (FindDTM(NoMon5, x, y, 0, 0, 1200, 700)) Then;
Wait(100);
Mon5:=true;
Wait(100);
end;
Procedure FindBattleScreen;
begin
StartbattleScreen := DTMFromString('m1gAAAHic42JgYKhjYmCQBNLPWBgY4oDsWij/KZCvBcS+QNwCxF+AYt5A7AvEbkA8j5GBYSoQTwHi+0D8AohfAnFPfy3DogZ7hr2zIxnaM10Y6pNdGfbOiWXYNSOK4ceFDIa/f/8ynF/my8AKNAMXZiQDIwAAekUcRQ==');
Wait(500);
WriteLn('Looking for Start Battle Screen');
If (FindDTM(StartBattleScreen, x, y, 0, 0, 1200, 700)) Then;
begin
WriteLn('Start Battle Screen Found and We Have Enough Energy');
WriteLn('Checking Monsters');
repeat
repeat
repeat
repeat
repeat
MonsterCheck;
Until(Mon1=true)
Until(Mon2=true)
Until(Mon3=true)
Until(Mon4=true)
Until(Mon5=true)
end;
WriteLn('All Monsters in Place');
Wait(75);
Mon1:=false;
Wait(75);
Mon2:=false;
Wait(75);
Mon3:=false;
Wait(75);
Mon4:=false;
Wait(75);
Mon5:=false;
end;
Procedure NetScreen;
var
x2, y2:integer;
begin
NetworkScreen := DTMFromString('mFQEAAHic42VgYGhmYmDgAeJzjAwM74C0PjMDw0Mgfg7EE4B8SaC4ABC/BfLboPx0IN4OxXuAeDcQswPljgDN28kAodOAYslAzA8U5wBiGzUphh8v1zKcmm0Hpo/NcmQ4tDCRoS7Zg2H9rEqGygQ3hoXtMQwr+pMYurLdGfbPS2AAAWYG0gAjGRgFAABsJCIA'); If (FindDTM(NetworkScreen, x, y, 0, 0, 1200, 700)) Then;
NetworkYes := DTMFromString('mVAEAAHicE2BgYBBkYmDgBGIuIBYGYn4gFgFiSSAWAuJDjAwM+4E4EsiOgao5CuRHQdmbgOz1QLwXqm4nFG8D4jVAPBWIzwPxNCC+DOWD9GwB4otA7KTBzBBhzcfgosXK8O7+EoYAcwEGR3UmhvQANQZ3XTaGJ6cbGba36DCcX+LFsL5KnuH+rkSG80u9GA5MMmfY3KDKwAz0AyWYkUKMDgDNPCNH');
If (FindDTM(NetworkScreen, x, y, 0, 0, 1250, 700)) Then
WriteLn('Unstable Network Connection Screen Found');
repeat
begin
If (FindDTM(NetworkYes, x2, y2, 0, 0, 1250, 700)) Then;
Wait(100+ Random(150));
MoveMouse(x2, y2);
Wait(100+ Random(150));
ClickMouse(x2, y2, 1);
Wait(200);
If not (FindDTM(NetworkScreen, x2, y2, 0, 0, 1250, 700)) Then
Wait(200);
WriteLn('Clicked Yes button');
Wait(100);
Clicked:=true;
end;
Wait(100);
until(clicked = true)
Wait(100);
Clicked:=false;
end;
Procedure StartBattle;
var
x1, y1:integer;
begin
Battlebutton := DTMFromString('mAAEAAHic42FgYLBnYWCwBGI3JLwAiB2A+BYzA8MlZgh7JhAvBGIeJgYGdiAWAGJeIBYG4kuMDAzngfgyEKsA+dpArAlVF2XDy/D5yQqG9AA1hh8v1zLcPjeT4cwCd4YHe9MZHu5NZdjZqsuwtVGdYVOtMsOBieYMQOtIwowkYmQAAMh7HTE=');
WriteLn('Searching for Battle Button');
If (FindDTM(Battlebutton, x1, y1, 0, 0, 1250, 700)) Then
WriteLn('Found Battle Button, Attempting to Click');
repeat
begin
Wait(100+ Random(197));
MoveMouse(x1, y1);
Wait(100+ Random(150));
ClickMouse(x1, y1, 1);
Wait(500);
If not (FindDTM(Battlebutton, x1, y1, 117, 168, 1250, 700)) Then
Wait(500);
Clicked:=true;
end;
until(Clicked = true);
Wait(100);
WriteLn('Clicked Sart Battle button');
Wait(100);
Clicked:=false;
Wait(2000+random(374));
end;
Procedure FindVmana;
var
a, b, i:integer;
begin
a := random(300+random(900));
b := random(300+random(400));
Vmana := DTMFromString('mlwAAAHicY2dgYPBmZGAwBeIwIE6E0vZAbAPE2UCcB8SBQJwOxLVQ+SYgdlv7icFhwweG5IM3GbhDZzEImaQzxJ67y8AVt5oBH2DEg6EAAJInD48=');
WriteLn('Waiting for Battle to End');
repeat
Wait(1000+random(6241));
If (FindDTM(Vmana, x, y, 289, 329, 358, 391)) Then
begin
nextround:=true;
i := 0;
Wait(100);
WriteLn('Battle is Over');
repeat
i := i+1;
Wait(100+ Random(150));
MoveMouse(a, b);
Wait(100+ Random(150));
ClickMouse(a, b, 1);
Wait(200);
WriteLn('Advanced Screen');
until(i = 2)
end;
until(nextround = true)
Wait(100);
nextround:=false;
Wait(300);
end;
Procedure ClickOKbutton;
begin
OKbutton := DTMFromString('mwQAAAHic42RgYGhkYmAwAGI9ID4DxCeBOA+Ie4G4GYhrgVgLiDmB2AmI3aFsTSDWAGIFINYH4mALAYaL8xwYNuQpMazNVWQ4Nc2C4cvTlQxteQ4Mr27NB+IFDMxA+whhRiIwHAAAhXsVAA==');
begin
Wait(300+ Random(150))
WriteLn('Looking For OK button');
If (FindDTM(OKbutton, x, y, 117, 168, 1200, 700)) Then
repeat
begin
WriteLn('Found OK button');
Wait(100+ Random(150));
MoveMouse(x, y);
Wait(100+ Random(150));
ClickMouse(x, y, 1);
Wait(200);
If not (FindDTM(OKbutton, x, y, 117, 168, 1200, 700)) Then
WriteLn('Clicked OK button');
Clicked:=true;
end;
until(Clicked = true);
Clicked:=false;
Wait(300);
end;
end;
Procedure RestartRun;
var
x2, y2:integer;
begin
begin
Restartbutton := DTMFromString('mVAEAAHicE2BgYOhkZGAIhuJyRggfhJcB8UkgfgzFD4FqfZkYGBYB2QFAvA8q3wrEtUDcDcSTgbgXiGuAuAeIG6HiHUCcBMRxQBwNxLlQ3AfEP16uxYm/nUtj+P5iDRiLcnMxiHHxMkS6GTI46IgCsRjDiW4tBkoBI4UYHQAAyS4uag==');
Wait(100+ Random(150))
WriteLn('Looking for Replay button')
If (FindDTM(Restartbutton, x2, y2, 0, 0, 1200, 700)) Then
WriteLn('Found Replay button');
repeat
Wait(100+ Random(150));
MoveMouse(x2, y2);
Wait(100+ Random(150));
ClickMouse(x2, y2, 1);
Wait(200);
If not (FindDTM(Restartbutton, x2, y2, 117, 168, 1200, 700)) Then
WriteLn('Clicked Replay button');
Clicked:=true;
until(Clicked = true)
Clicked:=false;
end;
end;
Procedure FreeDTMs;
begin
if DTMExists(OKbutton) = true then
FreeDTM(OKbutton);
if DTMExists(Vmana) = true then
FreeDTM(Vmana);
if DTMExists(Restartbutton) = true then
FreeDTM(Restartbutton);
if DTMExists(NetworkScreen) = true then
FreeDTM(NetworkScreen);
if DTMExists(NetworkYes) = true then
FreeDTM(NetworkYes);
if DTMExists(StartBattleScreen) = true then
FreeDTM(StartBattleScreen);
if DTMExists(Battlebutton) = true then
FreeDTM(Battlebutton);
if DTMExists(NoMon1) = true then
FreeDTM(NoMon1);
if DTMExists(NoMon2) = true then
FreeDTM(NoMon2);
if DTMExists(NoMon3) = true then
FreeDTM(NoMon3);
if DTMExists(NoMon4) = true then
FreeDTM(NoMon4);
if DTMExists(NoMon5) = true then
FreeDTM(NoMon5);
if DTMExists(StartbattleScreen) = true then
FreeDTM(StartbattleScreen);
end;
begin
Addonterminate('FreeDTMs');
repeat
begin
repeat
begin
Wait(299+ Random(5150));
StartBattle;
NetScreen;
FindVmana;
ClickOKbutton;
RestartRun;
Wait(100+random(30))
FreeDTMs;
end;
until(Clicked = true)
end;
until (IsKeyDown (114)); //F3 to Stop
End.