PDA

View Full Version : FindSymbolCustomColorIn



fORCE_wORKS
12-08-2007, 01:21 PM
Capable of Finding Symbol to 99% Accuracy. For the most part its the same as "FindSymbol" but instead of using the default Color from includes, you choose.

Ok. so say your using "FindSymbol" it can sometimes find a different symbol instead of the one your looking for. and then you turn up the SymbolAccuracy and dont find anything, darn. and then your script will probably logout the current player or make some feeble attempt at find it some other way. double darn. Well this function can turn up the SymbolAccuracy and still easly find the Symbols.

plus rep me if you like it.

{************************************************* ******************************
function FindSymbolCustomColorIn(var rx, ry, Color: Integer; Name: string; xs, ys, xe, ye: Integer): Boolean;
By: fORCE_wORKS Modified from (Starblaster100, based on the ideas of Stupid3ooo)
Description: Finds a minimap Symbol and returns a Boolean if True.
Searches a selected area of the Minimap, More Accurate than FindSymbolColorIn
************************************************** *****************************}
function FindSymbolCustomColorIn(var rx, ry, Color: Integer; Name: string; xs, ys, xe, ye: Integer): Boolean;
var
c, Speed, x, y: Integer;
acc: Extended;
begin
Speed := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
LoadSymbolBitmapColor(LowerCase(Name));
if (SymbolBitmap <> 0) then
begin
FindDeformedBitmapToleranceIn(SymbolBitmap, x, y, xs, ys, xe, ye, 70, 0, True, acc);
if (acc > SymbolAccuracy) then
begin
repeat
c := c + 5;
FindColorTolerance(x, y, Color, x, y, x + 15, y + 5, c);
until (GetColor(x,y) > 0) or (c > 70);
Result:= True;
rx := x;
ry := y;
end;
end else
Writeln('Please Enter a Valid Symbol Name!');
try
FreeBitmap(SymbolBitmap);
finally
ColorToleranceSpeed(Speed);
except
Result := False;
end;
end;

As well.
{************************************************* ******************************
function FindSymbolCustomColorIn(var rx, ry, Color: Integer; Name: string; xs, ys, xe, ye: Integer): Boolean;
By: fORCE_wORKS Modified from (Starblaster100, based on the ideas of Stupid3ooo)
Description: Finds a minimap Symbol and returns a Boolean if True.
Searches the whole Minimap, More Accurate than FindSymbol
************************************************** *****************************}
function FindSymbolCustomColor(var rx, ry, Color: Integer; Name: string): Boolean;
begin
Result := (FindSymbolCustomColorIn(rx, ry, Color, LowerCase(Name), 570, 5, 725, 166);
end;

this will grab the new symbol color then search for it.
if there no people in the way it can find a bank at 99% Accuracy.

begin
SymbolAccuracy:= 0.99;
writeln('Default Bank Color: '+IntToStr(LoadSymbolBitmapColor('bank')));
NewBankColor:= (GetSymbolColorIn(x,y,'bank',570, 5, 725, 166));
writeln('New Bank Color: '+IntToStr(NewBankColor));
writeln(BoolToStr(FindSymbolCustomColorIn(x,y,NewB ankColor,'bank',570, 5, 725, 166)));
MoveMouse(x,y);
end;

Raskolnikov
12-13-2007, 05:30 AM
rep ++!!! I like this, but, findsymbol always works for me. Would you mind if I used this in my includes?

fORCE_wORKS
12-13-2007, 05:32 AM
please do.