SRL Archive - OSR Help

P07_FindObjCustom is finding the object without it being there.


Gh0stt

2013-02-28 02:23:35

Hello!

I am currently trying to make a small script that will click a interactive object, I beleive that the following code checks/hovers over the two colours ([604509, 601162]), then if the UpText is ['Log'] it will left click..

What is happening is it seems to keep on spewing out UpText found… even though it is not looking to find the 'Log' or even the colour.


 procedure Log;
begin
repeat
if P07_FindObjCustom(x,y, ['Log'], [604509, 601162], 5) Then
Mouse(x,y, Random(2), Random(2), false);
writeln('UpText found...');
wait(500);
until(false)
end;


I am pretty confused, I have been looking around the forums for an answer but have not found anything.

What am I doing wrong?

Sorry for the noob question. I'm sure it'll be the first of many ;)

Thanks!

Sjoe

2013-02-28 02:35:00


procedure Log;
begin
repeat
if P07_FindObjCustom(x,y, ['Log'], [604509, 601162], 5) Then
BEGIN // u forgot begin and end;
Mouse(x,y, 2, 2, false); // no need for random(2), it is all random
writeln('UpText found...');
wait(500);
END;
until(false)
end;

If u have multiple actions for an if then … statement. We use a begin end;
if it's only ONE action. Then u do NOT need a begin end;

example:


if P07_FindObjCustom(x,y, ['Log'], [604509, 601162], 5) Then
Writeln('found it') // Only one action, no need for a new begin end;



if P07_FindObjCustom(x,y, ['Log'], [604509, 601162], 5) Then
begin // Multiple actions for the if then... we need a begin end;
Writeln('Found it')
Mouse(x, y,2,2, mouse_right);
end;

For your Color issue: use Autocolor aid.
Found here: http://villavu.com/forum/showthread.php?t=26944&highlight=autocoloraid
Tutorial on how to use it here: http://villavu.com/forum/showthread.php?t=71074

Gh0stt

2013-02-28 02:43:09

Thank you for the quick reply.

Am I just being silly or am I right about this:
The above code looks for (moves the mouse around) over the two colours ([604509, 601162]), then if the UpText is ['Log'] it will left click..



I think I should just look up some more tutorials. haha…

Sjoe

2013-02-28 02:46:50

Yeah that's what findobjcustom does. It searches for objects with that color and then checks the uptext.
So the function does 2 things.

Gh0stt

2013-02-28 03:21:42

From: Sjoekeloe
Yeah that's what findobjcustom does. It searches for objects with that color and then checks the uptext.
So the function does 2 things.


Ah, yes. I was unsure as when I used this the mouse would never move at all.

I will look into the Autocolor aid tool. It looks very useful!
Thanks once again.

Gh0stt

2013-03-01 07:44:36

I am posting in this thread as I am wondering what is wrong with this include: eg; P07_FindObj(x,y, 'onk',3423118,5) or the custom version.

Neither Mouse(x, y,2,2, mouse_left); or clickmouse2(mouse_left); click the mouse. It is finding it but for some reason its not clicking >.<!

Thanks..

Sjoe

2013-03-01 07:48:17

From: Gh0stt
I am posting in this thread as I am wondering what is wrong with this include: eg; P07_FindObj(x,y, 'onk',3423118,5) or the custom version.

Neither Mouse(x, y,2,2, mouse_left); or clickmouse2(mouse_left); click the mouse. It is finding it but for some reason its not clicking >.<!

Thanks..


Did u call P07Include in mainloop?

Post script?

Gh0stt

2013-03-01 08:04:10

Hello Sjeo, I have found the answer, I ask you to spread this around to stop people spamming the forums, like myself, with this question!

Here is the answer:

From: Prayer94
To all those having the problem of the scripts mouse hovering but not actually clicking go to simba in your c drive and make sure that the07upchars you downloaded is one folder.. As in not 07upchars with another 07upchars folder inside it.. This was my problem for all scripts and once I removed the secondary folder and had one folder with the up char files all my scripts worked.. If you dont understand I will try and explain better typed this in a rush sorry


Its my own fault for not checking the file.

Sjoe

2013-03-01 08:07:30

From: Gh0stt
Hello Sjeo, I have found the answer, I ask you to spread this around to stop people spamming the forums, like myself, with this question!

Here is the answer:



Its my own fault for not checking the file.


Oh u just misplaced the font include, ok :)

Gh0stt

2013-03-01 08:25:11

Yea, I unzipped it to the right location but the file was 07upchars with another 07upchars folder in it so Scar didnt realise they were in the second file so it didn't work..


But its fixed now! :D