SCAR Code:
{*******************************************************************************
function FindBar(var cx, cy : Integer; xs, ys, xe, ys : Integer; Bar : string) : Boolean;
By: R1ch
Description: Returns True if the bar specified in found in the place specified
Used Like: FindBar(x, y, MIX1, MIY2, MIX2, MIY2, 'Rune')
Valid "Bar": Bronze, Iron, Steel, Mith, Addy, Rune
*******************************************************************************}
function FindBar(var cx, cy : Integer; xs, ys, xe, ys : Integer; Bar : string) : Boolean;
var
BTF : Integer;
begin
case (Bar) of
'Bronze': BTF := DTMFromString('78DA635CC7C4C060C5C8800CA25C351944803' +
'448F43F10306E00AA31425503918591407A3B508D1901359B806A' +
'EC08A8590D54E34A40CD3CA01A4722D4581150B310A8C61CBF1A0' +
'07E6E0C2E');
'Iron': BTF := DTMFromString('78DA636C656260106164400689D1510C22401' +
'A24FA1F08187B806A0450D54064612490EE05AA1125A0A60DA846' +
'86809A1AA01A05026A8A806A2409A82907AA11C6AF0600E699097' +
'A');
'Steel': BTF := DTMFromString('78DA635CC3C4C020CAC8800C26B4B63208016' +
'990E87F2060DC0454C38FAA06220B2381F436A01A31026A3602D5' +
'481350B312A84691809AF94035B244A811C5542382AC6621508D3' +
'06E73D8801800ABCC0BFA');
'Mith': BTF := DTMFromString('78DA63BCCEC4C020CEC8800CBCBDF31944803' +
'448F43F1030DE06AAE147550391859140FA21508D10013577816A' +
'2409A801B9479E809AD340357204D41CC7F417869A3384DD0C00E' +
'40A0CA1');
'Addy': BTF := DTMFromString('78DA63CC66646098C38002FC93FD194480345' +
'086E13F10301600595319D000231209A44B30CDC1509303642D21' +
'A02605C85A46404D1490B590809A58206B3601350940D60CFC6A0' +
'043E00D52');
'Rune': BTF := DTMFromString('78DA637CC7C0C0B09F0105046497338800694' +
'620FE0F048C5F818C5D0C6880118904D25F80C421026ADE028993' +
'04D43C2142CD03207182809ABB40E22001357780C411026A1E028' +
'9BD04D47C0712FBF0AB0100A2AE160E');
end;
Result:= FindDTM(BTF, cx, cy, xs, ys, xe, ye);
end;
Quite a simple but handy function. If the bar that is specified is found in the area of the screen specified then it returns True.
Example:
SCAR Code:
if FindBar(x, y, MIX1, MIY2, MIX2, MIY2, 'Rune') then
Comments?