Fitta
2014-12-07 16:06:23
const
REWARD_RESOURCES = 0;
REWARD_UPGRADES = 1;
REWARD_BENEFITS = 2;
function isRewardOpen: boolean;
begin
Result := findTextTPA(2070783, 4, toBox(260, 35, 307, 48), 'Reward', 'UpChars07', -1);
end;
function getRewardTab: integer;
var
I, X, Y: Integer;
begin
If Not isRewardOpen then
Exit(-1);
For I:=0 to 2 do
If FindColorTolerance(X, Y, 1974407, 27+(I*90), 60, 109+(I*90), 79, 5)then
Exit(I);
end;
function rewardTab(I: Integer): boolean;
var
Tries: Integer;
begin
If (Not isRewardOpen)or(Not isLoggedIn) then
Exit(False);
repeat
If (getRewardTab = I)then
Exit(True)
else
mouseBox(IntToBox(27+(I*90), 60, 109+(I*90), 79), Mouse_Left);
Wait(500+Random(600));
Inc(Tries);
until(Tries > 3);
end;
function exitReward: boolean;
var
Tries: Integer;
begin
If Not isRewardOpen then
Exit(True);
repeat
If not isRewardOpen then
Exit(True)
else
mouseBox(IntToBox(477, 32, 494, 49), Mouse_Left);
Wait(500+Random(500));
until(Tries > 3);
end;Was going to include the chest in my script rewrite, never did though.
If someone finds it useful, enjoy.