Found the problem,
@slushpuppy; edited the ClickLeft case action line for some reason.. This made the click-able area be two fold, instead of the proper boxes. Again no idea why he changed that, but I requested a pull for a fix.
To see what I mean, here's a before (currently what's broke) and after (what the code should be). This is the only line that will need editing.
{ BEFORE - Bad}
(*
ChooseOptionMultiEx
~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
Finds Popup menu, then clicks on it.
Will look for the first string first and so on.
It will search for the Text Type you input valid arguments are
'action', 'player': The white text
'npc': The yellow text
'object': The cyan text
'all': Searches for all colors of text.
Will default to 'all'.
.. note::
by Wizzup? & Nava2 & N1ke!
Last Modified: 22/12/12 by riwu
Slushpuppy - 03 march 13
Example:
.. code-block:: pascal
*)
function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
var
B: TBox;
i, H, x, R: Integer;
T: TPoint;
Options: array of TOptions;
begin
Result := False;
Options := GetChooseOptions();
if (Length(Options) < 1) then
Exit;
H := High(Options);
for i := 0 To H do
begin
if ArrInStr(Texts, Options[i].Str) then
begin
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
R:= Min(((B.X2 - B.X1) shr 1), 5);
case Action of
ClickLeft:
begin
if PointInBox(T, B) then
ClickMouse2(true)
else // below line is faulty.. shouldn't be adding all these together
MouseBoxEx(T.x+ B.x1 + R, T.y+B.Y1 + 20, T.x+B.x2 - R, T.y+B.Y1 + 40, R, mouse_left);
end;
Move:
if not PointInBox(T, B) then
MouseBoxEx(B.x1 + R, B.Y1, B.x2 - R, B.Y1 + 5, R, mouse_move);
Nothing:
begin
end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
B := Options[0].BigBox;
if Action <> Nothing then
begin
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;
end;
{ AFTER - Good }
(*
ChooseOptionMultiEx
~~~~~~~~~~~~~~~~~~~
.. code-block:: pascal
function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
Finds Popup menu, then clicks on it.
Will look for the first string first and so on.
It will search for the Text Type you input valid arguments are
'action', 'player': The white text
'npc': The yellow text
'object': The cyan text
'all': Searches for all colors of text.
Will default to 'all'.
.. note::
by Wizzup? & Nava2 & N1ke!
Last Modified: 22/12/12 by riwu
Example:
.. code-block:: pascal
*)
function ChooseOptionMultiEx(Texts: TStringArray; TextType: String; Action: fnct_ActionOptions): Boolean;
var
B: TBox;
i, H, x, R: Integer;
T: TPoint;
Options: array of TOptions;
begin
Result := False;
Options := GetChooseOptions();
if (Length(Options) < 1) then
Exit;
H := High(Options);
for i := 0 To H do
begin
if ArrInStr(Texts, Options[i].Str) then
begin
Result := True;
B := Options[i].Bounds;
GetMousePos(T.x, T.y);
R:= Min(((B.X2 - B.X1) shr 1), 5);
case Action of
ClickLeft:
if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + R, B.Y1, B.x2 - R, B.Y1 + 5, R, mouse_Left);// reverted line (correct)
Move:
if not PointInBox(T, B) then
MouseBoxEx(B.x1 + R, B.Y1, B.x2 - R, B.Y1 + 5, R, mouse_move);
Nothing:
begin
end;
else
srl_warn('ChooseOptionMultiEx', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
end;
B := Options[0].BigBox;
if Action <> Nothing then
begin
x := Max(B.X1 - 52, 0);
if x = 0 then
x := B.X2+10;
MMouse(x, Max(B.Y1 - 50, 0), 40, B.Y2-B.Y1);
Wait(200 + Random(100));
end;
end;
https://github.com/SRL/SRL-OSR/pull/48