Results 1 to 8 of 8

Thread: FindSymbols crashing scar?

  1. #1
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default FindSymbols crashing scar?

    The function using it is

    Code:
    Function NextTreeGroup: boolean;
    var
      TreeGroups: TPointArray;
    begin
      SymbolAccuracy := 0.6;
      writeln('set symbol accuracy');
      if(FindSymbols(TreeGroups, 'rare trees'))then
      begin
      writeln('found symbols works');
        if(Length(TreeGroups) <= 1)then
        begin
          result := false;
          Exit;
        end else
        begin
        writeln('length works');
          if(Distance(TreeGroups[0].x, TreeGroups[0].y, MMCx, MMCy) > Distance(TreeGroups[1].x, TreeGroups[1].y, MMCx, MMCy))then
          begin
          writeln('distance works');
            Mouse(TreeGroups[0].x, TreeGroups[0].y, 2, 2, true);
            FFlag(0);
          end;
          if(Distance(TreeGroups[0].x, TreeGroups[0].y, MMCx, MMCy) < Distance(TreeGroups[1].x, TreeGroups[1].y, MMCx, MMCy))then
          begin
          writeln('distance works');
            Mouse(TreeGroups[1].x, TreeGroups[1].y, 2, 2, true);
            FFlag(0);
          end;
          result := true;
        end;
      end else
      begin
        writeln('didnt find symbols');
        result := false;
      end;
    end;
    .. and yes I've restarted scar

    If someone could figure out what the problem is or just put that in a script and see if it crashes scar for them, that would be great.

  2. #2
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Successfully compiled (5062 ms)
    SRL Compiled in 2406 msec
    set symbol accuracy
    didnt find symbols
    Successfully executed
    You have a problem with your scar, I recommend Uninstalling the whole program, including SRL, then re-installing again...

    GL.
    Hi

  3. #3
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for checking.

    edit: Did that and still crashes
    Last edited by bbri06; 12-29-2009 at 05:45 PM.

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    What exactly happens when it crashes, any error mesages or anything? If not, then make sure you bounds (like x1,y1,x2,y2) are actually a rectangle (like your x2 and y2 are larger integers than your x1 and y1) often times that happens and messes up scar.

    EDIT: Check the values of your distance functions maybe? Not sure if its possible but maybe your getting negative distances and need to rearrange the parameters?

    ALSO!
    In order to find exactly where the problem is occurring, have a bunch of WriteLns in your script, and whichever one it doesn't writeln, thats where they problem is.

    Just like after every few lines do Writeln('1'), Writeln('2') etc etc

  5. #5
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    The error is screen shotted and attached. I used the writeln error finding method to deduce that it was findsymbols causing the problem.

  6. #6
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Might want to show/tell Freddy about the problem then, that's odd. For now, just try using a different method.

  7. #7
    Join Date
    Oct 2006
    Posts
    468
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Alright thanks. I found a workaround way but I would just like to know why this won't work because now it's just driving me crazy haha. I'll pm him.

  8. #8
    Join Date
    Dec 2009
    Location
    Newcastle, Australia
    Posts
    888
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yo! I have an update for you all, I ran into this issue today, and Frement and myself went through FindSymbolsIN and both Came up with an error in PointInArray, which was crashing scar...both of us came up with this error independently...

    so i figured what PointInArray does was check if a point was in the array, and since I figured it was broke, I created a substitute function, which should work, and I am going to test it, and if it works, Hopefully we can get this pesky function working again...

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
  •