Results 1 to 7 of 7

Thread: PO7Include findobj problem

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

    Default PO7Include findobj problem

    Hey I just started scripting and having some problems using FindObj, this is the part of my script not working.


    Simba Code:
    procedure findTree;
    var
      X,Y:Integer;
    begin
    if P07_FindObj(x, y, 'Chop', 3232106, 6) then
         begin
            mmouse(x, y,0,0);
            wait(250);
            ClickMouse(X, Y, mouse_Right)
           end;
    end;

    When I run this procedure in an area with trees it will simply hover the mouse to each tree in the area and then stop, so it seems like it actually finds the right object it just won't run the if clause when it does and continues to find more. Total noob so if I missed something fundamental about how findObj works please explain

  2. #2
    Join Date
    May 2008
    Location
    Mental Hospital
    Posts
    414
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Yesterday when I was making a script I found that up text is acting funny. Try 'Chop down Treename' or 'Chop down Treename'(Double Spaces. Yesterday it was picking up spaces as two spaces for me)
    Last edited by Noob King; 02-26-2013 at 11:31 PM.

  3. #3
    Join Date
    Jan 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I seem to be having the same problem as OP.
    Using the P07_FindObj will make the mouse hover over the selected color with the appropriate uptext, but it just keeps hovering on different spots without ever clicking.

    I used a similar code :
    Simba Code:
    Program finddoor;

    {$I SRL/SRL.Simba}
    {$I P07Include.Simba}

    var
    x, y: integer;

    Procedure door;

    Begin
      if P07_FindObj(x, y, 'arge', 1858422, 5) then
        ClickMouse2(mouse_left)
      else
      writeln('fail');
    End;

    Begin
      SetupP07Include;
      door;
    End.

    Anyone who had this problem or knows how to fix it can help?

  4. #4
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by pyryny View Post
    I seem to be having the same problem as OP.
    Using the P07_FindObj will make the mouse hover over the selected color with the appropriate uptext, but it just keeps hovering on different spots without ever clicking.

    Anyone who had this problem or knows how to fix it can help?
    It's because my Uptext function is not 110% accurate like the normal srl one, you need to use one string from the white text, and one from the blue/yellow text,

    For example, for mining, If P07_FindObjCustom(x,y,['Mine','Rock'],[color],5) Then ClickMouse2(mouse_left);


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  5. #5
    Join Date
    Jan 2013
    Posts
    11
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    Thanks for quick answer Danny.
    Works like a charm now

  6. #6
    Join Date
    Nov 2012
    Posts
    2,351
    Mentioned
    55 Post(s)
    Quoted
    603 Post(s)

    Default

    Quote Originally Posted by pyryny View Post
    Thanks for quick answer Danny.
    Works like a charm now
    No Problem

    Glad I've located an issue people keep having, now I know its probably because they don't understand that things can not be 100% accurate,

    Imagine if you used only white text while the main screen (behind the text) is covered in snow? Not going to work very well if at all


    Programming is like trying keep a wall of shifting sand up, you fix one thing but somewhere else starts crumbling

  7. #7
    Join Date
    Feb 2013
    Posts
    8
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Thanks for the help Danny but still having problems using this code
    Simba Code:
    procedure findTree;
    var
      X,Y:Integer;
    begin
    If P07_FindObjCustom(x,y,['Chop','Tree'],[323106,3561845],5) then
       begin
       ClickMouse2(mouse_left);
       end;
    end;

    It will hover from tree trunk to tree trunk including oaks etc so it just finds the colors but not the text apparently :/

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
  •