I worked in the beginning but now it always says, HOpenBank Did Not Open The Bank. But It always opens the bank! so there is something wrong :S.
SCAR Code:
Program LMAO;
{.Include SRL/SRL.Scar}
Var
X, Y:Integer;
Function HIsBankOpen(MaxTime:Integer; CheckForPinScreen:Boolean):Boolean;
Var
Timer :Integer;
Begin
MarkTime(Timer);
Repeat
Wait(100);
If CheckForPinScreen Then Result:=PinScreen;
If Result Then Break;
Until (BankScreen or (TimeFromMark(Timer) > MaxTime));
Result:= TimeFromMark(Timer) < Maxtime;
If Not Result Then Writeln('Failed To Find The BankScreen.');
End;
Function HUptext(Text:TStringArray):boolean;
Var
MaxTime:Integer;
Begin
MarkTime(MaxTime);
Repeat
Wait(10);
Result:= IsUpTextMultiCustom(Text);
Until (result Or (TimeFromMark(MaxTime)>100));
Result:=TimefromMark(MaxTime)<100
End;
Function HOption(Text:string):boolean;
Var
MaxTime:Integer;
Begin
MarkTime(MaxTime);
repeat
Wait(10);
Result:= ChooseOption(Text);
Until result Or (TimeFromMark(MaxTime) > 100);
Result:= TimefromMark(MaxTime) < 100 ;
End;
Function HOpenBank:Boolean;
Var
TempTpa: TpointArray;
Temp: T2DPointArray;
H, CTS, I, TempX, TempY, M:Integer;
Begin
If Not BankScreen Then If Not LoggedIn Then Exit;
M:=GetSystemTime;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsSpiralTolerance(TempX, TempY, TempTPA, 2575958, MSX1+120, MSY1+120, MSX2-120, MSY2-120, 10);//738138
Temp:= TPAtoATPAEx(TempTPA, 15, 15);
SortATPASize(Temp, True);
H:=High(Temp);
For I := 0 To H Do
Begin
MiddleTPAEx(Temp[i], TempX, TempY);
Writeln('Found The Bank In '+IntToStr(GetSystemTime - M)+' MiliSecs.');
MMouse(TempX, TempY, 0, 0);
Result:=HUpText(['erald']);
If Result Then Break;
Wait(100);
End;
If Result Then
Begin
Mouse(TempX, TempY, 0, 0, False);
Result:=HOption('ank');
If Result Then Result:=HIsBankOpen(10000,True);
If Pinscreen Then Result:= InPin(InttoStr(Players[CurrentPlayer].Integers[0]));
If Result Then Result:=HIsBankOpen(10000,False);
end;
If Result Then Writeln('HOpenBank Succesfully Openend The Bank. In '+IntToStr(GetSystemTime - M)+' MiliSecs.');
If Not result Then Writeln('HOpenBank Did Not Open The Bank. ');
ColorToleranceSpeed(CTS);
MakeCompass('N');
End;
Begin
SetUpSRL;
End.