SRL Archive - OSR Help

ChooseOption


Sax

2012-11-20 18:18:16

I know it is a noob question. But could someone make an example using ChooseOption or other function like this? It's just that it is not working for me… So could anyone do me this?

Laimonas171

2012-11-20 18:21:08

From: Nirvana
I know it is a noob question. But could someone make an example using ChooseOption or other function like this? It's just that it is not working for me… So could anyone do me this?



if(FindColorTolerance(x, y, 2279655 , MCX1, MCY1, MCX2, MCY2, 32)) then
begin
mouse(x, y, 5, 5, false);
wait(200+random(150));
WaitOption('e All', 500);
end;

edit:


also you can check or you have that option.
by
OptionsExist(['e all'], false); // false does nothing if option found it returns TRUE, if you change it to (next line)
OptionsExist(['e all'], true); // if found option it moves mouse on that option but do not click (i guess) not tested though. still should return true.

// in both way if not find option returns false


Sax

2012-11-20 18:43:13

Well I was doing it correctly I dont know why but it doesn't work for me. I mean the mouse moves but when it is supposed to cchoose the option the script stops. And it says successfully executed.

Laimonas171

2012-11-20 18:47:41

From: Nirvana
Well I was doing it correctly I dont know why but it doesn't work for me. I mean the mouse moves but when it is supposed to cchoose the option the script stops. And it says successfully executed.


Hm, Make sure, SRL is included and setupSRL;, is in main section, I have noticed that if you run not from smart sometimes scripts act strange do do things so make sure you run it on smart :)

program NoName;
{$DEFINE SMART}
{$i srl/srl.Simba} //here
procedure mainloop;
var x, y:integer;
begin
if(FindColorTolerance(x, y, 2279655 , MSX1, MSY1, MSX2, MSY2, 32)) then
begin
mouse(x, y, 5, 5, false);
wait(200+random(150));
WaitOption('here', 500);//walk here option
end;
end;

begin
Smart_FixSpeed := true;//if smart loads quite too long.. :)
SetupSRL; //here
wait(20000); wait 20sec till you manually login.
repeat
mainloop; //this will repeat searching for 2279655 color, and if finds it,
// right clicks it and chooses "walk here"; if starts to walk it works well though..
until(false);
end;

EDIT: didn't tested so don't judge me :D it's 2AM here, going to sleep though.. if didn't helped i will try to help tomorrow, good night for now :)

Roflme

2012-11-21 13:12:38

What text are you trying to find?

I find that doing Multiple Options of very small strings works far more often than using longer strings. Sometimes the strings will not be recognized. I couldn't find 'eleport' option but I could find 'ele' and 'port' for some odd reason when I searched for multiple options. So try to split it up like that (whatever text you're finding).

litoris

2012-11-21 13:38:41

Use WaitOptionMulti.
example, for attacking:

if not WaitOptionMulti(['ttack', 'tack', 'Att'], RandomRange(300,600)) then
Writeln('Failed!')
else Writeln('Success!');

Sax

2012-11-21 18:22:44

Sorry didn't reply cuz I have been busy. Thank you all for your reply. I knew the functions and how to use them it just didnt work for some reason. Well I ran the script in smart and worked fine.

Now Im getting a problem in uptext detection. Sometimes it detects but other times it doesn't even though it is always the same item.

Silentcore

2012-11-21 18:42:27

From: Nirvana
Sorry didn't reply cuz I have been busy. Thank you all for your reply. I knew the functions and how to use them it just didnt work for some reason. Well I ran the script in smart and worked fine.

Now Im getting a problem in uptext detection. Sometimes it detects but other times it doesn't even though it is always the same item.


Why not post the script here…