SRL Archive - OSR Help

Chooseoption not working?


rife

2012-04-21 22:21:54

Hey folks,

Quick question here which may just be me missing something blatantly obvious.

I've got the following code:

begin
MouseBox(696, 133, 716, 151, 2);
Wait(100 + Random(200));
ChooseOption('ast');
Wait(100 + Random(50));
InvMouse(i, 1);
end;

That MouseBox is for the summoning button around the minimap. The mouse rolls over the button but will not chooseoption or even right click to chose.

What am I missing here?

Gucci

2012-04-21 22:23:44

You need to have it right click first so something like:

Mouse(x, y, 2, 2, False);

or

ClickMouse2(mouse_right);

So like this:

begin
MouseBox(696, 133, 716, 151, 2);
Wait(100 + Random(200));
ClickMouse2(mouse_right);
Wait(200 + Random(200));
ChooseOption('ast');
Wait(100 + Random(50));
InvMouse(i, 1);
end;

tehq

2012-04-21 22:27:12

If you're using a wait before and after, why not use a WaitOption function?

Brandon

2012-04-21 22:28:54

I believe that's the reason for the MouseBox.. It right clicks for him when the last parameter is set to 2 aka MOUSE_RIGHT.

ChooseOption has has a bug for weeks where it won't choose the option.. The fix is to do:

a Repeat loop with a If (NOT ChooseOption) embedded.


Tries:= 0;

repeat
MouseBox(696, 133, 716, 151, 2);
Wait(100 + Random(200));
if ChooseOption('ast') then
begin
Wait(100 + Random(50));
InvMouse(i, 1);
break;
end;
Inc(Tries);
until(Tries > 5);

Gucci

2012-04-21 22:38:08

From: ggzz
I believe that's the reason for the MouseBox.. It right clicks for him when the last parameter is set to 2 aka MOUSE_RIGHT.

ChooseOption has has a bug for weeks where it won't choose the option.. The fix is to do:

a Repeat loop with a If (NOT ChooseOption) embedded.


Tries:= 0;

repeat
MouseBox(696, 133, 716, 151, 2);
Wait(100 + Random(200));
if ChooseOption('ast') then
begin
Wait(100 + Random(50));
InvMouse(i, 1);
break;
end;
Inc(Tries);
until(Tries > 5);


But he said it isn't right clicking either, didn't know it was bugged been working fine for me

rife

2012-04-21 22:50:39

Thanks for the help, I'll give both options a try when I get home and see how it goes.

Rich

2012-04-22 07:25:40

If it's not right-clicking either, then try replacing MouseBox with
MouseOval(706, 142, 10, 9, mouse_Right);
GetMousePos(mX, mY);
Wait(500 + Random(300));
Mouse(mX, mY, 0, 0, false);
You'd need to add mX and mY as integers.

rife

2012-04-22 08:36:17

ClickMouse2(mouse_right);

Did the trick perfectly.

Thanks you ridiculously helpful people!