SCAR Code:
{*******************************************************************************
Procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);
by: SRL Dev Team
Description: WriteLn's a warning message.
*******************************************************************************}
Const
warn_AllVersions = 0;
warn_Terminate = -1;
warn_Warning = -2;
Procedure srl_Warn(ProcName, ErrorMessage: String; wVersion: Integer);
Begin
Case wVersion Of
warn_Terminate: begin end;
warn_AllVersions: begin end;
warn_Warning: If Not ShowWarnings Then
Exit;
Else If wVersion <> SRLVersionNumber Then
Exit;
End;
WriteLn('** Warning in ' + ProcName + ': ' + ErrorMessage + '**');
If wVersion = -1 Then
TerminateScript;
End;
SCAR Code:
Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
Var
DepositX: Boolean;
All: Variant;
I, T, x, y: Integer;
Begin
If Not BankScreen Then
Exit;
If vType = 2 Then
srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
DepositX := False;
Case VarType(vType) Of
3: Begin
DepositX := Not InIntArray([1, 5, 10], vType);
If vType = 1 Then
All := False
Else
All := True;
End;
11: All := vType;
End;
For I := 1 To 28 Do
Begin
If Not ExistsItem(I) Then
Continue;
MouseItem(I, Not All);
If DepositX Then
Begin
ChooseOption('Store X');
T := GetSystemTime;
While (Not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) And (GetSystemTime - T < 3000) Do
Wait(100);
TypeSend(vType);
End Else If VarType(vType) = 3 Then
ChooseOption('Store ' + vType)
Else
ChooseOption('Store All');
T := GetSystemTime;
While ExistsItem(I) And (GetSystemTime - T < 2000) Do
Wait(50);
End;
End;
SCAR Code:
function ChooseOption(txt: string): Boolean;
var
B: TBox;
P: TPointArray;
X, Y: Integer;
begin
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
FindColorsTolerance(P, 4674653, B.X1, B.Y1, B.X2, B.Y2, 0);
If Length(P) = 0 Then
Exit;
B := GetTPABounds(P);
If FindText(X, Y, txt, upchars, B.X1, B.Y1, B.X2, B.Y2) Then
Begin
Result := True;
Mouse(B.X1 + 5, y + 1, Random(B.X2 - B.X1), random(13), True);
End
Else
begin
MMouse(B.X1 - 50, B.Y1 - 50, 40, B.Y2 - B.Y1);
Wait(200 + Random(100));
end;
end;