From: Harry
It's probably because I use R_ChooseOptionSpecial, which is probably out of date. I hate Jagex for making the choose-option text for shark-harpoon the same as the tuna/sword-harpoon. I'll change that soon.
This is what i use. As Temp fix and it works pretty good :)
function H_ChooseOptionMultiEx(Texts: TStringArray; TextType: string; Action: fnct_ActionOptions): Boolean;
var
B, OptionBox: TBox;
TPA, TPA1, TPA2, TextTPA: TPointArray;
aTPA: T2DPointArray;
I, H, HH, ii, L: Integer;
Colors, SearchCols: TIntegerArray;
begin
Result := False;
GetClientDimensions(B.X2, B.Y2);
B.X1 := 0;
B.Y1 := 0;
Dec(B.X2);
Dec(B.Y2);
FindColorsTolerance(TPA1, 4343893, B.X1, B.Y1, B.X2, B.Y2, 0);
FindColorsTolerance(TPA2, 3950929, B.X1, B.Y1, B.X2, B.Y2, 0);
TPA := CombineTPA(TPA1, TPA2);
if Length(TPA) < 10 then
Exit;
B.X2 := 0;
B.Y2 := 0;
aTPA := SplitTPAEx(TPA, 20, 20);
SortATPASize(aTPA, True);
B := GetTPABounds(aTPA[0]);
Colors := [13034990, 4231423, 2070783, 65535, 16776960, 9812166, 16777215];
TextType := LowerCase(TextType);
case TextType of
'action', 'player': SearchCols := [0, 5, 6];
'item': SearchCols := [1, 2];
'npc': SearchCols := [3];
'object': SearchCols := [4];
else
SearchCols := [0, 1, 2, 3, 4, 5, 6];
end;
L := High(SearchCols);
SetLength(aTPA, l + 1);
for i := 0 to l do
FindColorsTolerance(aTPA[I], Colors[SearchCols[I]], B.X1, B.Y1, B.X2, B.Y2, 3);
TPA := MergeATPA(aTPA);
aTPA := SplitTPAEx(TPA, 15, 1);
L := High(aTPA);
H := High(Texts);
SortATPAFromFirstPoint(ATPA, Point(OptionBox.X1, optionbox.y1));
for I := 0 to H do
begin
TextTPA := LoadTextTPA(Texts[i], UpChars, HH);
for ii := 0 to L do
if FindTextTPAInTPA(HH, TextTPA, aTPA[ii], TPA) then
begin
Result := True;
case Action of
ClickLeft: MouseBoxEx(B.x1 + 5, TPA[0].Y, B.x2 - 5, TPA[0].Y + 5, 5, 1);
Move: MouseBoxEx(B.x1 + 5, TPA[0].Y, B.x2 - 5, TPA[0].Y + 5, 5, 3);
Nothing: begin end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
end;
MouseSpeed := 12;
if not H_ChooseOptionMultiEx(['Compete', 'ompete'], 'all', ClickLeft) then
begin
if H_ChooseOptionMultiEx(['Competition', 'ompetit'], 'all', Move) then
begin
GetMousePos(a, b);
MMouse(a + 150, b, 1, 1);
ChooseOptionMulti(['Compete', 'ompete']);
~Home