bg5
2012-05-16 14:06:19
GetMiniMapDots doesn't work for me ,always returns empty tpa. Anyone can test and confirm?
2012-05-16 14:06:19
2012-05-16 14:11:47
2012-05-16 14:22:46
2012-05-16 14:29:51
From: beginner5
white , yellow , red.
2012-05-16 14:38:24
Maybe all the colours changed again
2012-05-16 14:49:50
From: beginner5
Everything other is running well.
That's what I think ,colours changed or it's something wrong with my simba.
{$DEFINE SMART}
{$I SRL/SRL.Simba}
begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
writeln(GetMiniMapDots('npc'));
end.
2012-05-16 14:57:25
Simba is released under the GPL license.
You are currently using version: 990
Compiled with FPC version 2.4.4
2012-05-16 15:05:41
From: beginner5
I have 990 too
But why only this function doesn't work? I have bunch of FindcolorsTolerance with cts2 and finding DTMs with cts1 in script ,and they works corectly.
2012-05-16 15:27:15
{$DEFINE SMART}
{$I SRL/SRL.Simba}
function GMM(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
var
I, Dif, Radius, Hi, C: Integer;
TPA: TPointArray;
begin
case LowerCase(WhatDot) of
'npc', 'n', 'yellow', 'y': Dif := 4369;
'item', 'i', 'red', 'r': Dif := 23;
'player', 'p', 'white', 'w': Dif := 1907997;
'friend', 'f', 'green', 'g': Dif := 5376;
'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
{'clan', 'c', 'orange', 'o': Dif := -1;}
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
Freeze;
FindColorsTolerance(TPA, 65536, MMX1, MMY1, MMX2, MMY2, 1);
writeln(TPA); //TPA Will print everything found.. This is a hell of a lot!
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
writeln(TPA); //This prints absolutely nothing! Also tested other minimap functions, all that use filterpoints or findcolorspie are broken.
Hi := High(TPA);
SetLength(Result, Hi + 1);
if (Hi < 0) then
begin
UnFreeze;
Exit;
end;
C := 0;
for I := 0 to Hi do
begin
if (GetColor(TPA[I].X-1, TPA[I].Y-1) - GetColor(TPA[I].X, TPA[I].Y-1) = Dif) then
begin
Result[C] := Point(TPA[I].x, TPA[i].y - 2);
Inc(C);
end;
end;
Unfreeze;
SetLength(Result, C);
end;
var
X, Y: Integer;
begin
Smart_Server:= 72;
Smart_Members:= True;
Smart_Signed:= True;
Smart_SuperDetail:= False;
SetupSRL;
MakeCompass('N'); //To test if it's broken.. It's not.. It does not use FindColorsPie or FilterPointsPie..
writeln(GMM('npc', MMX1, MMY1, MMX2, MMY2)); //Completely broken..
end.
2012-05-16 15:31:34
2012-05-16 15:35:03
From: ReadySteadyGo
https://github.com/MerlijnWajer/Simba/commit/56a74cf624463ad4278308103552609cfff755a1
Looking into it.
Function FilterPointsCircle(TPA: TPointArray; MX, MY, Radius: Integer): TPointArray;
var
I, L: Integer;
begin
L:= High(TPA);
For I:= 0 To L do
begin
if (InCircle(TPA[I].X, TPA[I].Y, MX, MY, Radius)) then
begin
SetLength(Result, Length(Result) + 1);
Result[I + 1]:= TPA[I];
end;
end;
end;
function GMM(WhatDot: String; x1, y1, x2, y2: Integer): TPointArray;
var
I, Dif, Radius, Hi, C: Integer;
TPA: TPointArray;
begin
case LowerCase(WhatDot) of
'npc', 'n', 'yellow', 'y': Dif := 4369;
'item', 'i', 'red', 'r': Dif := 23;
'player', 'p', 'white', 'w': Dif := 1907997;
'friend', 'f', 'green', 'g': Dif := 5376;
'team', 't', 'blue', 'b', 'cape': Dif := 2171941;
{'clan', 'c', 'orange', 'o': Dif := -1;}
else
srl_Warn('GetMiniMapDotsIn', '"' + WhatDot + '" is not a valid dot type', warn_AllVersions);
end;
Freeze;
FindColorsTolerance(TPA, 65536, MMX1, MMY1, MMX2, MMY2, 1);
TPA:= FilterPointsCircle(TPA, MMCX, MMCY, 75);
Hi := High(TPA);
SetLength(Result, Hi + 1);
if (Hi < 0) then
begin
UnFreeze;
Exit;
end;
C := 0;
for I := 0 to Hi do
begin
if (GetColor(TPA[I].X-1, TPA[I].Y-1) - GetColor(TPA[I].X, TPA[I].Y-1) = Dif) then
begin
Result[C] := Point(TPA[I].x, TPA[i].y - 2);
Inc(C);
end;
end;
Unfreeze;
SetLength(Result, C);
end;
var
X, Y: Integer;
NPCs: TPointArray;
begin
Smart_Server:= 72;
Smart_Members:= True;
Smart_Signed:= True;
Smart_SuperDetail:= False;
SetupSRL;
MakeCompass('N'); //To test if it's broken.. It's not.. It does not use FindColorsPie or FilterPointsPie..
NPCs:= GMM('npc', MMX1, MMY1, MMX2, MMY2);
SortTPAFrom(NPCs, Point(MMCX, MMCY));
MMouse(NPCs[0].X, NPCs[0].Y, 0, 0);
end.
2012-05-16 15:42:56
2012-05-16 15:50:25
Any function using FilterPointsPie or FindColorsPie is broken..
FilterPointsPie(TPA, 0, 360, 0, 12, 534, 63);FilterPointsPie(TPA, 0.01, 360, 0, 12, 534, 63);
2012-05-16 15:52:23
2012-05-17 10:32:38