SRL Archive - OSR Help

Need help ChooseOption();


JellysThree

2013-05-25 17:10:52

Hello
Not entirely sure if this is the correct place to ask..

Repeat
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
Mouse(x, y, 0, 0, false);
ChooseOption('Net');

This doesn't work ^
What is wrong with it and how do I fix it?
It finds the fishing spot correctly then right clicks
It then just continues to find more fishing spots and right clicks

The Mayor

2013-05-25 17:21:58

From: JellysThree
Hello
Not entirely sure if this is the correct place to ask..

Repeat
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
Mouse(x, y, 0, 0, false);
ChooseOption('Net');

This doesn't work ^
What is wrong with it and how do I fix it?
It finds the fishing spot correctly then right clicks
It then just continues to find more fishing spots and right clicks


If you have more than 1 line following a 'then' you will need a begin and end, like so:

if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
begin
Mouse(x, y, 0, 0, false);
ChooseOption('Net');
end;

However, no begin or end is required if 1 line follows the 'then', like so:

if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
writeln('we found the fishing spot');


E: and it is also a good idea to exclude the first capital letter from a chooseOption. So ChooseOption('Net') could be ChooseOption('et').

JellysThree

2013-05-25 17:27:40

Thanks bro!

JellysThree

2013-05-25 17:37:08

Hm, I have attempted to fix it but it still doesn't work correctly.

Procedure FishShrimp;
var x, y: integer;
begin
repeat
Wait(50);
WriteLn('Looking');
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
begin
WriteLn('Found');
Mouse(x, y, 0, 0, false);
ChooseOption('et');
repeat
Wait(1200+random(250));
Until not IsUpText('Net Fishing spot') or (InvFull);
End;
until(InvFull);
End;

This is the procedure I am trying to run. Thanks

Sjoe

2013-05-25 17:54:54

From: JellysThree
Hm, I have attempted to fix it but it still doesn't work correctly.

Procedure FishShrimp;
var x, y: integer;
begin
repeat
Wait(50);
WriteLn('Looking');
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then
begin
WriteLn('Found');
Mouse(x, y, 0, 0, false);
ChooseOption('et');
repeat
Wait(1200+random(250));
Until not IsUpText('Net Fishing spot') or (InvFull);
End;
until(InvFull);
End;

This is the procedure I am trying to run. Thanks


Since ChooseOption will be executed instantly after Mouse, you will not give simba enough time to search for the options.
so u have to add a little wait after Mouse


Mouse(x, y, 0, 0, false);
Wait(300);
ChooseOption('et');

However, what is way more accurate than ChooseOption is WaitOption!


Mouse(x, y, 0, 0, false);
WaitOption('et', 600');
WaitOption will loop ChooseOption for a maxtime of 600 miliseconds. Exits early if option is found.

JellysThree

2013-05-25 18:07:04

The script is not actually getting past the
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then

It does not write the line "Found" so I assume it is not actually getting passed the if statement.
Any ideas why?

The Mayor

2013-05-25 18:20:16

From: JellysThree
The script is not actually getting past the
if FindObj(x, y, 'Net Fishing spot', 15052923, 30) then

It does not write the line "Found" so I assume it is not actually getting passed the if statement.
Any ideas why?


Try changing 'Net Fishing spot' to 'ishing'.

JellysThree

2013-05-25 18:25:36

if FindObj(x, y, 'ishing', 15052923, 30)
Did not work either =/

Sjoe

2013-05-25 18:27:21

From: JellysThree
if FindObj(x, y, 'ishing', 15052923, 30)
Did not work either =/


Pick your color and take a lower tolerance, 30 is way too high. preferable 7-15 (try lower first)

Having said this, Try using Autocoloraid to pick your colors. This is way more accurate.
Here's a great video to get you started! http://villavu.com/forum/showthread.php?t=71074

JellysThree

2013-05-25 18:32:19

I just tried lowering it but it continues to hop from fishing spot to fishing spot.
It is identifying the fishing spot accurately (so I assume the color also) but isn't following through the if statement.

Sjoe

2013-05-25 18:34:57

From: JellysThree
I just tried lowering it but it continues to hop from fishing spot to fishing spot.
It is identifying the fishing spot accurately (so I assume the color also) but isn't following through the if statement.


Then it must be an uptext issue. Try hovering your mouse above the fishing spot and debug writeln(Getuptext);
Check if that's accurate.

JellysThree

2013-05-25 18:37:13

Sorry but how do I debug?

Sjoe

2013-05-25 18:39:07

From: JellysThree
Sorry but how do I debug?


writeln(Getuptext);

Try this first: FindObjMulti(x, y, ['Net', 'ish, 'ing', 'spot'], [15052923], Tol)

rj

2013-05-25 18:39:10

From: JellysThree
Sorry but how do I debug?


Include osr,

Begin
Wait(2000)
Writeln(rs_getuptext)
End.

JellysThree

2013-05-25 18:50:59

From: Officer Barbrady
Include osr,

Begin
Wait(2000)
Writeln(rs_getuptext)
End.


Ok so I did this
Writeln(P07_GetUpText);
Writeln(rs_getuptext);

And it printed
Net Fishing spot
^pb [|a^|&q a^pb ^ & ^p[p p^b|p&a

JellysThree

2013-05-25 18:52:03

From: Sjoe
writeln(Getuptext);

Try this first: FindObjMulti(x, y, ['Net', 'ish, 'ing', 'spot'], [15052923], Tol)


The second method didn't compile

Sjoe

2013-05-25 18:53:49

From: JellysThree
The second method didn't compile


U have to replace Tol with your value dummy

JellysThree

2013-05-26 04:35:16

I did

The Mayor

2013-05-26 04:48:47

From: JellysThree
I did


maybe try this:


Procedure FishShrimp;
var x, y: integer;

begin
repeat
Wait(RandomRange(50, 100));
WriteLn('Looking for spot');
if FindObjCustom(x, y, ['Net', 'ish', 'ing', 'spot'], [15052923], 15) then
begin
WriteLn('Found spot');
Mouse(x, y, 0, 0, false);
WaitOptionMulti(['et', 'et Fis'], 600);
end else
writeln('Failed to find spot');
repeat
Wait(500+random(250));
until not IsUpTextMultiCustom(['et', 'net Fis']) or (InvFull);
until(InvFull);
end;

JellysThree

2013-05-26 04:53:31

Ok I tried that and it made no difference.
It prints the line 'Failed to find spot'

The Mayor

2013-05-26 05:00:28

From: JellysThree
Ok I tried that and it made no difference.
It prints the line 'Failed to find spot'



Ok that means it didn't find the fishing spot colour.

   
.//add in a whole bunch of colours here like this
if FindObjCustom(x, y, ['Net', 'ish', 'ing', 'spot'], [15052923, 42343, 4324, 4234], 15) then


JellysThree

2013-05-26 05:04:45

Ok I tried that and the mouse still hops from fishing spot to spot.
It finds the spots color and moves the mouse to it but it doesn't register it as a fishing spot

The Mayor

2013-05-26 05:06:23

From: JellysThree
Ok I tried that and the mouse still hops from fishing spot to spot.
It finds the spots color and moves the mouse to it but it doesn't register it as a fishing spot


Ahh right. Do you have the 2007 fonts installed properly? It is not recognizing the Uptext.



Edit: Halfway down this post there is a link and screenshot of where to put the fonts.

JellysThree

2013-05-26 05:08:35

Well, I have the P07UpChars in the Fonts folder is that all I need to do

The Mayor

2013-05-26 05:12:04

From: JellysThree
Well, I have the P07UpChars in the Fonts folder is that all I need?


Nope :)

See above post. You should have all of these folders in the the simba font folder (C:/simba/fonts/)


I hope you're not using the P07 Include :eek: you should be using SRL-OSR.

JellysThree

2013-05-26 05:16:58

Well, that may be the source of the problem =/

Yeah I believe I am using P07 Include. Can you link me SLR-OSR

The Mayor

2013-05-26 05:30:32

From: JellysThree
Well, that may be the source of the problem =/

Yeah I believe I am using P07 Include. Can you link me SLR-OSR


The P07Include can make things messy if you have modified SmartParams and those other files. To avoid any issues later on it is best to uninstall simba (and delete the simba folder) and start fresh.

1. Install simba and make sure SRL is updated (look at the quick setup guide).

2. You might as well get SMART8 as you will have to get it eventually anyway.

3. Install SRL-OSR Include. Download the zip from here and extract it to C:\Simba\Includes\

Make sure the folder is named SRL-OSR not SRL-OSR-master, like this:


4. Put the 07 fonts in the fonts folder like I showed you before :)

Sjoe

2013-05-26 05:33:43

also include srl-osr in your script with

{$i SRL\OSR-SRL.simba}

JellysThree

2013-05-26 05:38:20

Where can I download the 07 fonts?

The Mayor

2013-05-26 05:48:21

From: JellysThree
Where can I download the 07 fonts?


Here