SRL Archive - SRL Suggestions

ChooseOptionDual


Shuttleu

2012-01-19 17:34:23

much the same as the reflection equivalent but in colour

its quite hard to explain what it does so here is a example

on fishing spots there are two spots which includes nets and two which include harpoons

so one might be
Cage and Harpoon
the next one might be
Harpoon and Net

if there are two spots on top of each other then it could easily get them mixed up
so you want to choose the harpoon that is on the cage spot, but it could choose the harpoon on the net spot

what this does is you enter the first and second options (so cage and harpoon) then you can put whether you want it to choose the first option or the second option

function ChooseOptionDual(First, Second: string; FirstOption: Boolean; Action: fnct_ActionOptions): Boolean;
var
B: TBox;
i, H, ii, L, x: Integer;
T: TPoint;
Options: array of TOptions;
begin
Result := False;
Options := GetChooseOptions('jack shit');
if (Length(Options) < 1) then
Exit;
H := High(Options);
for ii := 0 to H-1 do
If Pos(First, Options[ii].Str) > 0 Then
If Pos(Second, Options[ii+1].Str) > 0 Then
begin
Result := True;
if FirstOption then
B := Options[ii].Bounds
else
B := Options[ii+1].Bounds
GetMousePos(T.x, T.y);
case Action of
ClickLeft: if PointInBox(T, B) then
ClickMouse2(true)
else
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 1);
Move: if not PointInBox(T, B) then
MouseBoxEx(B.x1 + 5, B.Y1, B.x2 - 5, B.Y1 + 5,5, 3);
Nothing: begin end;
else
srl_warn('ChooseOptionDual', 'ClickRight not a valid click for RS menus!', warn_AllVersions);
end;
Exit;
end;
B := Options[0].BigBox;//to mmouse away
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;

~shut

Coh3n

2012-01-20 01:08:40

I don't understand. Why not just do:

WaitUptext('age and Harp', 200);
?

Harry

2012-01-20 01:20:00

From: Coh3n
I don't understand. Why not just do:

WaitUptext('age and Harp', 200);
?

They are on 2 different lines. One above another.

At fishing guild etc it's like so:
Cage spot
Harpoon spot
Net Spot
Harpoon spot
First harpoon does swordfish, 2nd one does sharks. Same names. Different lines.

Does this work with the "hidden" menu though Shuttleu? The menu that expands when it's too long of a chooseoption?

Flight

2012-01-20 01:25:06

Yeah this would be handy for this exactly purpose. I believe, however, N1ke (or whatever his name was) made this in the past. I assume it doesn't work now?

grats

2012-01-20 03:55:12

yea would be awesome for places like the fishing guild.. for sharks

Shuttleu

2012-01-20 04:23:54

From: Harry
They are on 2 different lines. One above another.

At fishing guild etc it's like so:
Cage spot
Harpoon spot
Net Spot
Harpoon spot
First harpoon does swordfish, 2nd one does sharks. Same names. Different lines.

Does this work with the "hidden" menu though Shuttleu? The menu that expands when it's too long of a chooseoption?


unfortunately no, but im not too sure how to do it without it being… ugly

~shut

Narcle

2012-01-20 04:31:06

I think this should be made into array setup (for more just in case). Also with this add to this (or another function) to do hidden menus. Like

ChooseOptionMany(['fishing spot', 'Cage'], HiddenMenu, FirstOption: boolean): boolean;

something like that

Coh3n

2012-01-20 14:40:56

From: Harry
They are on 2 different lines. One above another.

At fishing guild etc it's like so:
Cage spot
Harpoon spot
Net Spot
Harpoon spot
First harpoon does swordfish, 2nd one does sharks. Same names. Different lines.

Does this work with the "hidden" menu though Shuttleu? The menu that expands when it's too long of a chooseoption?
Oh, I see. :)

From: Narcle
I think this should be made into array setup (for more just in case). Also with this add to this (or another function) to do hidden menus. Like

ChooseOptionMany(['fishing spot', 'Cage'], HiddenMenu, FirstOption: boolean): boolean;

something like that
I agree. The "sub-menus" can probably be added in ChooseOptionMultiEx (or maybe not, I'm not sure).

Are there any other instances this may happen, other than when fishing?