Log in

View Full Version : [Runtime Error] : divide by Zero in line 80 in script



dvdcrayola
08-26-2007, 07:19 AM
[Runtime Error] : divide by Zero in line 80 in script C:\Program Files\SCAR 3.11\includes\SRL/SRL/Core/Mouse.scar

is what i get when i run:
program New;
{.Include SRL/SRL.scar}

var x, y: integer;

function FatherColor: Integer;
var
X, Y, Z: Extended;
Points: TPointArray;
Colors, UniqueColors: TIntegerArray;
i, a: Integer;
NewColor: Boolean;
begin
if not LoggedIn then Exit;
ColorToleranceSpeed(0);
FindColorsSpiralTolerance(MMCX, MMCY, Points, 3421241, MMX1, MMY1, MMX2, MMY2, 17);
if Length(Points) < 1 then
begin
ColorToleranceSpeed(1)
Exit;
end;
Colors := GetColors(Points);

for i := 0 to Length(Colors) -1 do
begin
NewColor := True;
for a := 0 to GetArrayLength(UniqueColors) - 1 do
begin
if(UniqueColors[a] = Colors[i])then
begin
NewColor := False;
Break;
end;
end;
if(NewColor)then
begin
SetArrayLength(UniqueColors, GetArrayLength(UniqueColors) + 1);
UniqueColors[GetArrayLength(UniqueColors) - 1] := Colors[i];
end;
end;
for i := 0 to Length(UniqueColors) -1 do
if UniqueColors[i] <> 0 then
begin
ColorToXYZ(UniqueColors[i], X, Y, Z);
if (X < 7) and (X > 0) then
if (Y < 7) and (Y > 1) then
if (Z < 7) and (Z > 0) then
if CountColor(UniqueColors[i], MMX1, MMY1, MMX2, MMY2) > 50 then
begin
WriteLn('AutColor: '+IntTostr(UniqueColors[i]))
Result := UniqueColors[i];
Break;
end;
end;

ColorToleranceSpeed(1);
end;

var i: integer;
begin
activateclient;
wait(2000)
for i:=1 to 4 do
begin
If FindColorTolerance(x,y,FatherColor,MSX1,MSY1,MSX2, MSY2,5) then
begin
MMouse(x,y,0,0);
Writeln('Found');
end else
Writeln('didnt find on try' + inttostr(i));
wait(1000);
end;
end.

btw im testing which color works best.. if you needed to know.. thanks

HyperSecret
08-26-2007, 07:40 AM
i think its giving you a wrong error, but i did notice that you forgot a semicolon behind

activateclient;
wait(2000)

the wait right there see if that fixes it

dvdcrayola
08-26-2007, 07:49 AM
no it doesnt.. semicolons dont always have to be after procedures with perameters, they should be though.

thanks for trying =]

nielsie95
08-26-2007, 08:20 AM
Call SetupSRL or set MouseSpeed :)

ShowerThoughts
08-26-2007, 09:22 AM
dude i gonna kill you for this i am not stupid grr mines will released before yours grrr/get on msn/

rotflmfwao
08-26-2007, 02:49 PM
Why are you telling everyone to get on MSN?
Btw, it doesn't matter whose is relleased 1st, but whose is better :p

dvdcrayola
08-26-2007, 04:06 PM
Call SetupSRL or set MouseSpeed

i feel stupid:duh:


dude i gonna kill you for this i am not stupid grr mines will released before yours grrr/get on msn/

im on msn.. i wish i saved the conversation where i said.. im going to make a restless ghost runner.. and you said... im going to make one first. and i said why? and you said to make you mad

:rolleyes:


Why are you telling everyone to get on MSN?
Btw, it doesn't matter whose is relleased 1st, but whose is better

thats the way im looking at it too.