SRL Archive - Help

ChooseOption wont work.


Ultra

2012-12-11 12:24:17

procedure Fight;
begin
if(FindColorTolerance(X, Y, 3348339, 0, 0, 580, 405, 15))then
begin
MMouse(X, Y, 3, 3);
Wait(10 + Random(10));
ClickMouse2(false);
Wait(200+Random(100));
if(ChooseOptionMulti(['Attack', 'ttack']))then
WriteLn('Attacked a spider!');
end;
end;
Never clicks "Attack" or displays "Attacked a spider!". Any thoughts? :redface: Getting back to scripting lol.

EDIT Now using:
ChooseOptionMulti(['Attack', 'ttack]))
still wont choose the attack option. :(

litoris

2012-12-11 12:31:10

Use ChooseOptionMulti, put more words in there(ie. 'ack', 'ck')
You can also try WaitOption(Multi if you want) so that you don't have to add a wait after the click.

Ultra

2012-12-11 12:35:46

Now using:
ChooseOptionMulti(['tta', 'ack', 'ttack', 'ck']))

Still wont choose it*, could it perhaps be that the monster is higher level than me?

DannyRS

2012-12-11 12:37:55

Use option multi, and use 'Attack' 'ttack' the * will cause problems otherwise

Ultra

2012-12-11 12:40:35

Still no luck :(

DannyRS

2012-12-11 12:44:31

It attempts to read the first letters, can you try

ChooseOptionMulti(['*Attack', 'Attack', 'ttack','tac']))

It has been fairly buggy lately though, you could consider recording mouse position of click and clicking within y+22 - y+44

Tht would hit the first option, depends on detection of spider acuracy though :)

Ashaman88

2012-12-11 13:05:12

Do an else and writeln(getchooseoptions) i think is the command, will show you what simba is seeing

Also, use waitchooseoptionmulti, tis the best

Wardancer

2012-12-11 13:49:49

It might fail because it runs the line before the options tab is correctly opened. You can try to increase the waiting time before the line to see if that's an issue. Nonetheless, I strongly suggest using WaitOptionMulti(['Attack', 'ttack'], 1000).

Sax

2012-12-11 14:10:54

I have had the same exact problem..

Le Jingle

2012-12-11 14:12:54

are you using the latest simba?

just tested some lumbridge spiders with your posted find color x,y

program Lumby_Spiders;
{$i srl/srl.simba}
{$i srl/srl/misc/debug.simba}

var
x, y, bmp: integer;
options: array of TOptions;
begin
setupsrl;
if (FindColorTolerance(X, Y, 3577013, MSX1, MSY1, MSX2, MSY2, 15)) then
begin
MMouse(X, Y, 3, 3);
Wait(10 + Random(10));
ClickMouse2(false);
Wait(2000 + Random(100));
options := GetChooseOptions('all');
writeln(options[0].Str);
CopyclientToBitmap(bmp, options[0].BigBox.X1, options[0].BigBox.Y1,
options[0].BigBox.x2, options[0].BigBox.y2);
DebugBitmap(bmp);
end;
end.

footballjds

2012-12-11 14:13:26

issues with simba's OCR. Ongoing issue… :( it needs fixed.