SCAR Code:
{*******************************************************************************
function CountEmptyVials : Integer;
By: R1ch
Description: Gets amount of empty vials in inventory
*******************************************************************************}
function CountEmptyVials : Integer;
begin
Result:= CountItems('bmp',srl_GetBitmap(srl_Empty_Vial), []);
srl_FreeBitmaps;
end;
{*******************************************************************************
function CountFullVials : Integer;
By: R1ch
Description: Gets amount of full vials in inventory
*******************************************************************************}
function CountFullVials : Integer;
begin
Result:= CountItems('bmp',srl_GetBitmap(srl_Full_Vial), []);
srl_FreeBitmaps;
end;
{*******************************************************************************
function CountAllVials : Integer;
By: R1ch
Description: Gets amount of vials in inventory
*******************************************************************************}
function CountAllVials : Integer;
begin
Result:= CountEmptyVials + CountFullVials;
end;
{*******************************************************************************
function EmptyVials(Amount : Integer) : Boolean;
By: R1ch
Description: Emptys Amount vial in the inventory.
*******************************************************************************}
function EmptyVials(Amount : Integer) : Boolean;
var
I, X, Y : Integer;
E, F : TIntegerArray;
begin
srl_LoadBitmaps([110, 111]);
if (CountFullVials < Amount) then
begin
srl_Warn('EmptyVials', 'Incorrect amount: ' + IntToStr(Amount), warn_AllVersions);
srl_FreeBitmaps;
Exit;
end;
F[0]:= CountFullVials;
E[0]:= CountEmptyVials;
for I:= 1 to Amount do
begin
if FindBitmapToleranceIn(srl_GetBitmap(srl_Full_Vial), X, Y, MIX1, MIY1, MIX2, MIY2, 15) then
begin
MMouse(X, Y, 8, 8);
GetMousePos(X, Y);
if WaitUpTextMulti(['ial', 'ater'], 300) then
begin
Mouse(X, Y, 0, 0, False);
WaitOptionMulti(['mpty', 'ial', 'ater'], 300);
end;
end else
begin
srl_FreeBitmaps;
Exit;
end;
end;
F[1]:= CountFullVials;
E[1]:= CountEmptyVials;
if ((E[0] - E[1]) = Amount) then
if ((F[0] - Amount) = F[1]) then
Result:= True;
srl_FreeBitmaps;
end;
{*******************************************************************************
function NoVials : Boolean;
By: R1ch
Description: Emptys Amount vial in the inventory.
*******************************************************************************}
function NoVials : Boolean;
begin
Result:= (CountAllVials = 0);
end;
SCAR Code:
bmp_Empty_Vial: Result := BitmapFromString(13, 18, 'beNpjYEAFjEgIJ6gvtspPNY4' +
'L1fZ2UcKtknHH8pBtS4OBqKvWvjTbDJcyiJqNCwPbq+2KMkzwK1s/' +
'P6ClwhZoO6a94eExUdHxEKNWzfJrKrPOSTJ0cvZwd/dBNicpKQ0Zh' +
'YXHBASGeXsH2to6ISvLzs4DopwcKAoJjfL3D3V0cjcyNkOymrGkpA' +
'yCiopKCgqKgoMj3dy8zS1s1NW1UF3IuGrV2i1btm7evGXjps1AG+3' +
'snLGFM2NGRnZlZVUNGABtdHBwxRbCjIWFRVVV1UAEBBCHYVUGNAqI' +
'IABoqbOLh6mZFZqa3Nz8iopKOIJ4wcLSFtmbiUmp5eUVcDUJiSmhY' +
'dGeXv7WNg4mphYwlYz5+YXIyoC6IiPjvH0C7e1dgGECUZacnFZaWg' +
'ZUBkdAkejoBD+/EKAvYAYy5OUVlJWVwxFQWUpKemxcUmBQuIurJzD' +
'0QAYCANcanbA=');
bmp_Full_Vial: Result := BitmapFromString(9, 12, 'beNpzS2YAAcZtS4OBaOPCwPZqu' +
'6IMEwYoYIRLrZ8f0FJhm59qDJEID4+Jio6HaFk1y6+pzDonydDJ2c' +
'Pd3ScpKQ0ZhYXHBASGeXsH2to6ZWfnAVFODhSFhEb5+4c6OrkbGZu' +
'VlJRBUFFRSUFBUXBwpJubt7mFjbq6FtANq1at3bJl6+bNWzZu2gw0' +
'zc7OGeI2IMrIyK6srKoBA6BpDg6uYHGQ4wsLi6qqqoEICCAWwaXWb' +
'zwO1AUBQAOdXTxMzayA4tNn71m74RgEAdVk5s+Oim9198kCuWHtkT' +
'Xrj0KkaprX5xQtjEnq9AkocAIA+nR08w==');
Quite self explanatory. And they now use bitmaps instead of DTMs.