since you are starting to script its always nice to use standards
before:
begin
SetUpSrl;
ActivateClient;
DeclarePlayers;
LoginPlayer;
PositionCompass;
repeat
repeat
OpeningBank;
until(BankScreen)
DepositingVials;
ProgressReport;
Withdrawing;
Casting;
until(AllPlayersInactive);
end.
After
begin
SetUpSrl;
ActivateClient;
DeclarePlayers;
LoginPlayer;
PositionCompass;
repeat
repeat
OpeningBank;
until (BankScreen) DepositingVials;
ProgressReport;
Withdrawing;
Casting;
until (AllPlayersInactive);
end.
as for coding wise, have a look at mine ( it may not be the very good) but there are a few differences
When banking
use a wait untill thing to check up bankscreen instead of waiting
so
Before
procedure OpeningBank;
begin
If FindObj(x, y, 'se', 10329508, 10) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('ank');
Wait(1000 + Random(1000)); //im guessing your waiting for bank to open
end;
end;
after:
Function OpeningBank:boolean; //changing it into a function so it returns a positive if sucessful.
var
t:integer;
begin
If FindObj(x, y, 'se', 10329508, 10) then
begin
Mouse(x, y, 5, 5, false);
ChooseOption('ank');
MarkTime(t); // marks time as a failsafe
Repeat // constantly here checks for if bankscreen is open also checking time from clicking as a failsafe
If (TimeFromMark(t) > 5000) then // if it takes longer than 5 seconds it exits the function returning a 'zero/False' value
Begin
Writeln('Failed To Open Bank'); //For debug purposes
Exit; // breaks out of function
End;
Until (BankScreen); // checks for if bankscreen is open
Result := True; // returns true if found-no if statement required as if it takes longer than failsafe time, it skips this part of the code
end;
end;