SRL Archive - SRL Suggestions

OrderWorlds fix


RISK

2011-12-14 22:38:56

{*******************************************************************************
Procedure OrderWorlds(by: string; Descending: boolean);
by: NaumanAkhlaQ - Fixed by RISK
Description: Orders worlds by 'by' in order 'Descending'
Check function for valid params of 'by'
Descending = true means the left button
*******************************************************************************}
Function OrderWorlds(by: string; Descending: boolean): boolean;
var
ATPA: T2DPointArray;
Arr: array of tstringarray;
TPA: TPointArray;
I: Byte;
TB: TBox;
begin
Arr := [TStringArray(['world', 'w', 'worlds']), TStringArray(['players', 'pl', 'player']), TStringArray(['activity', 'location', 'loc', 'act']),
TStringArray(['type', 't']), TStringArray(['ls', 'lootshare']), TStringArray(['ping', 'pi'])];

for I := 0 to High(Arr) do
begin
if (InStrArr(Lowercase(By), Arr[i], False)) then
begin
FindColorsTolerance(TPA, SRL_WS_ARROWCOLOR, 92, 0, 716, 200, 1);

ATPA := SplitTPA(TPA, 2);
SortATPAFromFirstPoint(ATPA, Point(92, 166));

if (Length(ATPA) < (I * 2)) then
Exit;

TB := GetTPABounds(ATPA[(I * 2) + Integer(Descending)]);
MouseBox(TB.x1 + 2, TB.y1 + 2, TB.x2, TB.y2, 1);

Result := True;
end;
end;
end;

I fixed the bug where it would be unable to find "Type", I fixed the standards (In my opinion) and I fixed where it would misclick on the arrow by 1 ~ 2 pixels to the left.

Coh3n

2012-01-04 01:22:36

Committed to SRL5.