Quickmarch
2009-10-02 19:12:22
Today I got a "[Runtime Error] : Out Of Range in line 379 in script C:\Program Files\SCAR 3.22\includes\SRL\SRL\Core\WorldSwitcher.scar" error in the OrderWorlds procedure.
Fix:
Might also be a good idea to make this return a Boolean.
Fix:
procedure OrderWorlds(by: string; Descending: boolean);
var
ATPA: T2DPointArray;
Arr: T2DStringArray;
TPA: TPointArray;
I: Byte;
TB: TBox;
Begin
if not(WorldScreen) then Exit; //<--- Added this line
Arr := [TStringArray(['world', 'w', 'worlds']), TStringArray(['players', 'pl', 'player']), TStringArray(['activity', 'location', 'loc', 'act']),
TStringArray(['ls', 'lootshare']), TStringArray(['type', 't']), TStringArray(['ping', 'pi'])];
For I := 0 To High(Arr) Do
If InStrArr(Lowercase(By), Arr[i], False) Then
Break;
FindColorsTolerance(TPA, 1074576, 0, 0, 716, 141, 1);
ATPA := SplitTPA(TPA, 2);
SortATPAFromFirstPoint(ATPA, Point(91, 124));
TB := GetTPABounds(ATPA[(I * 2) + Integer(Descending)]);
MouseBox(TB.x1, TB.y1, TB.x2, TB.y2, 1);
end;
Might also be a good idea to make this return a Boolean.