Results 1 to 10 of 10

Thread: P07_FindObjCustom is finding the object without it being there.

  1. #1
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default P07_FindObjCustom is finding the object without it being there.

    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.


    Code:
     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!

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Simba Code:
    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:

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

    Simba Code:
    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....t=autocoloraid
    Tutorial on how to use it here: http://villavu.com/forum/showthread.php?t=71074

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    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...

  4. #4
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

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

    Creds to DannyRS for this wonderful sig!

  5. #5
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Sjoekeloe View Post
    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.

  6. #6
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    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..

  7. #7
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Gh0stt View Post
    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?

    Creds to DannyRS for this wonderful sig!

  8. #8
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    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:

    Quote Originally Posted by Prayer94 View Post
    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.

  9. #9
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    Quote Originally Posted by Gh0stt View Post
    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

    Creds to DannyRS for this wonderful sig!

  10. #10
    Join Date
    Feb 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •