Hi I have the new srl installed with scar divi 3.11. I have been trying to run one of my scripts I made with srl 3.81. I declared x and y as global variables and all that. The problem is with Mouse(); The script compiles fine, but when I run it, it says
Then it opens up Mouse.scar. The code around the problem area is[Runtime Error] : divide by Zero in line 79 in script C:\Program Files\SCAR 3.11\includes\SRL/SRL/Core/Mouse.scar
I understand you can't divide a number by 0. So I tried to changeprocedure MMouse(x, y, rx, ry: integer);
var
cx, cy: integer;
randSpeed: extended;
begin
randSpeed:= (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
getMousePos(cx,cy);
x:= x + random(rx);
y:= y + random(ry);
WindMouse(cx,cy,x,y,9.0,3.0,10.0/randSpeed,15.0/randSpeed,10.0*randSpeed,10.0*randSpeed);
end;torandSpeed:= (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
Then when I ran the script, the mouse was like wierd. So does anyone have any helpfull suggestions?randSpeed:= ((1 + random(MouseSpeed)) / 2.0 + MouseSpeed) / 10.0;
Thanks
EDIT: I figured out that it works, all you have to do is declare your MouseSpeed var at the begining of your main loop... sorry




Reply With Quote
