SRL Archive - RS3 Help

chooseOption.select


rsbots2013

2014-02-13 17:24:53

How do I get the script to choose the option? Won't work for me.
If I didn't give enough detail let me know.

From Script:

If findDTMRotatedAlternating(Teleport_To_Citadel_1, x, y, 1, 1, 1595, 921, -Pi/2, Pi/2, Pi/30, aFound) or
findDTMRotatedAlternating(Teleport_To_Citadel_2, x, y, 1, 1, 1595, 921, -Pi/2, Pi/2, Pi/30, aFound) then
begin
writeLn('Attempting to teleport to Clan Citadel!');
mouse(x, y, 3, 3, MOUSE_MOVE);
wait(4000);
begin
fastClick(MOUSE_RIGHT);
wait(3000);
if chooseOption.select(['uick']) then
wait(3000);
end;
end else
begin
writeLn('Couldnt find Clan Citadel Teleport Portal!');
end;
end;

Debug box:
-- chooseOption._select():
---- chooseOption.isOpen(): result = false
---- ERROR: chooseOption menu never appeared
-- chooseOption.select() result = false
Successfully executed.

rsbots2013

2014-02-13 22:07:50

I fixed the problem. I changed…

if chooseOption.select(['uick']) then
TO
if chooseOption.select(['ick']) then

Coh3n

2014-02-13 22:09:57

Unfortunately, the text reading isn't perfect and this will happen from time to time. I highly recommend putting multiple variations of the text you want to find in the function arguments.

if (chooseOption.select(['Quick', 'uick', 'ick']) then

rsbots2013

2014-02-13 22:30:54

Thanks Coh3n, I will add multiple text to that part. :)

slacky

2014-02-14 04:58:26

From: Coh3n
Unfortunately, the text reading isn't perfect and this will happen from time to time. I highly recommend putting multiple variations of the text you want to find in the function arguments.

if (chooseOption.select(['Quick', 'uick', 'ick']) then


Such usage of multiple variations is useless. "ick" is in all the options, so "ick" is all that is needed, since it falls back to that no matter what.
Doing multiple checks in such a manner will only slow down the process, and not result in anything helpful.

Coh3n

2014-02-14 15:25:36

From: warpie
Such usage of multiple variations is useless. "ick" is in all the options, so "ick" is all that is needed, since it falls back to that no matter what.
Doing multiple checks in such a manner will only slow down the process, and not result in anything helpful.
Not true. Say that (for whatever reason) 98% of the time 'Quick' works just fine, but for that other 2%, 'ick' works. You're saying I should just look for 'ick' all the time, but what if there happens to be some unexpected options to appear (like 'Pickup' for example)? It might click the wrong 'ick' when searching for 'Quick' would have worked. Of course, 'Quick' could fail and it could still click the wrong option, but that's what additional options are for. There's a very very small chance that all will fail before getting to the last option (unless of course the option doesn't exist).

As for speed, I think that's a useless argument in this situation. You could run the function a million times with 5 options, and a million times with 1 and you won't notice a difference in speed.

In the case of the OP's problem you might be right because it looks like they're looking for a teleport symbol, but in general it's beneficial to use multiple variations of the option you're trying to find.

Olly

2014-02-14 15:43:38

Well, in the op it says the menu wasn't found… So i dunno how changing the text fixed that, but good its working. :)

I r actually re-doing chooseoption as we speak… though nothing will change user side. :)