SRL Archive - OSR Help

FindSymbols crashing scar?


bbri06

2009-12-28 22:41:53

The function using it is


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.

Tickyy

2009-12-29 04:52:33

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.

bbri06

2009-12-29 05:31:42

:( Thanks for checking.

edit: Did that and still crashes

YoHoJo

2009-12-29 12:49:09

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

bbri06

2009-12-30 00:31:29

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

YoHoJo

2009-12-30 01:37:37

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

bbri06

2009-12-30 01:57:35

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.

Bad Boy JH

2010-02-03 00:45:18

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…