SRL Archive - SRL Archives

Two New Symbols =P


_ChArMz

2007-01-31 18:35:27

Program Test;
{.Include SRL/SRl.scar}

Function CharmGetSymbolColor(var rx, ry: Integer; Name: string): Integer;
Var
Bitmap, Color, c: Integer;
acc: Extended;
Begin
Bitmap := 0;
If (LowerCase(Name) = 'kebab') or (LowerCase(Name) = 'kebab seller') then
Begin
Bitmap := BitmapFromString(15, 5, 'z78DA8D8E310E04210C03BF9' +
'41C018E3290E5FF4FDA3D4CE186D33696E58C46914B3F3A468486' +
'236BB62B69E9CFDECBF4648D73CEE426DF58D7C58067832CA7901' +
'98C4E371DF0A023E164F3C97F32EF0F89DFFFAF74A92967ECE8DD' +
'5AAD652FD17FC8C1CCFCFBFEDFFCC6CF09929D6CBE01614964E3');
Color := 1877023;
End;
If (LowerCase(Name) = 'sand') or (LowerCase(Name) = 'sandpit') then
Begin
Bitmap := BitmapFromString(15, 5, 'z78DA8DCF410AC0200C04C0' +
'2F35B575CD3189F5FF4F6A693C0482E06509B23B2035EA8776743' +
'38E69AC72B55E8CEF798FF10088393B694BBF49495E99FEB2E367' +
'99817A9668FA1DCD7C7B53F8DBEA4A6EA87252F6F32FB2E9A9509' +
'3A5EC19FB3BE9AB28BF8FF568DB');
Color := 7858175;
End;
If (Bitmap = 0) then
Begin
WriteLn('Please enter a valid symbol name');
Exit;
End;
FindDeformedBitmapToleranceIn(Bitmap, x, y, 570, 5, 725, 160, 70, 0, True, acc);
If (acc > SymbolAccuracy) then
Begin
Repeat
c := c + 5;
If (FindColorTolerance(x, y, Color, x, y, x + 15, y + 5, c)) then
Begin
Result := GetColor(x, y);
WriteLn('Color = '+IntToStr(Result));
rx := x;
ry := y;
End;
Until (Result > 0) or (c > 70);
End;
FreeBitmap(Bitmap);
End;

Begin
SetupSRL;
//CharmGetSymbolColor(x, y, 'sandpit');
CharmGetSymbolColor(x, y, 'kebab seller');
MMouse(x, y, 0, 0);
End.

Tested in a few worlds worked fine, I believe the kebab symbol has just been updated, but the sandpit is a new symbol..