Log in

View Full Version : I keep getting an error in "MouseFlag.scar"



Immortal_DemiGod
11-08-2007, 07:57 AM
I keep getting this error in ALOT of scripts

Line 431: [Error] (3034:26): Unknown identifier 'MMX1' in script C:\Documents and Settings\Dad\Desktop\Junk\srl\srl\core\MouseFlag.s car

not nessessarily the same line though...


//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- » Mouse Flag & Chat Routines --//
//-----------------------------------------------------------------//
// * procedure Swap(var a, b: Integer); // * by PPLSUQBAWLZ
// * procedure swapPoint(var a, b: TPoint); // * by PPLSUQBAWLZ
// * procedure Bubble(var a: TPointArray; var d: TIntegerArray; N: Integer); // * by Mutant Squirrle
// * function MakeMouseSplinePath(Sx, Sy, Ex, Ey, MaxDist, CtrlDist, CtrlVar: integer): TPointArray; // * by BenLand100and and modified by Ron
// * function MMouse(dx, dy, RandX, RandY: Integer): Boolean; // * by BenLand100/Mutant Squirrle
// * procedure IdleTime(Time, Rand: integer; Gravity: extended); // * by BenLand100
// * procedure IdleColor(Rand, Gravity, Color, Tol, X1, Y1, X2, Y2: Integer; Exists: Boolean); // * by BenLand100
// * procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean); // * by Mutant Squirrle
// * procedure SleepAndMoveMouse(Time: Integer); // * by RSN
// * function Flag: Boolean; // * by PPLSUQBAWLZ/Odie533
// * function FlagPresent: Boolean; // * by Mutant Squirrle
// * function FlagDist: Integer; // * by PPLSUQBAWLZ/Odie533
// * function FlagDistance: Integer; // * by PPLSUQBAWLZ/Odie533
// * procedure MouseFlag(cx, cy, rx, ry: Integer); // * by RsN
// * procedure MouseFindFlag(ax, ay, xmod, ymod: Integer); // * by PPLSUQBAWLZ
// * procedure MouseFindNoFlag(ax,ay,xmod,ymod:integer); // * by PPLSUQBAWLZ
// * procedure MouseUntilFlag(xmod, ymod: Integer); // * by ?
// * function HumanCircleFlag(Dist: Integer): Boolean; // * by Wizzup? and WT-Fakawi.
// * procedure FFlag(Distance: Integer); // * by Wizzup? / WT-Fakawi.
// * procedure ChatsOff; // * by RsN
// * procedure SetChat(state: String; chat: Integer); // * by RSN and modified by Ron/Cheesehunk
// * procedure MouseBox(xs, ys, xe, ye: Integer; click: Integer); // * by XxKanexX
// * procedure Drag(x1, y1, rx1, ry1, x2, y2, rx2, ry2: Integer; left: Boolean); // * by Zup
// * procedure MouseBack(cx, cy, RanX, RanY, RandomEnd, PercentReturn, Click: Integer); // * by phantombmx


{ const smooth;
Description: If you want human-like mouse movements. }
const
SRL_Smooth = True;

{ const clicktiming;
Description: Wait in ms after the mouse has clicked. }
const
SRL_ClickTiming = 100;

{ const clicktimingran;
Description: Random amount to wait after mouseclick. }
const
SRL_ClickTimingRan = 100;

{************************************************* ******************************
procedure Swap(var a, b: Integer);
By: PPLSUQBAWLZ
Description: Swaps a for b
************************************************** *****************************}

procedure Swap(var a, b: Integer);
var
c: Integer;
begin
c := a;
a := b;
b := c;
end;

{************************************************* ******************************
procedure swapPoint(var a, b: TPoint);
By: PPLSUQBAWLZ
Description: Swaps TPoints.
************************************************** *****************************}

procedure swapPoint(var a, b: TPoint);
var
c: TPoint;
begin
c := a;
a := b;
b := c;
end;

{************************************************* ******************************
procedure Bubble(var a: TPointArray; var d: TIntegerArray; N: Integer);
By: Mutant Squirrle
Description: Swaps Point for highes Integer to be first.
************************************************** *****************************}

procedure Bubble(var a: TPointArray; var d: TIntegerArray; N: Integer);
// By Mutant Squirrle
var
i, j: Integer;
begin
for i := N downto 0 do
for j := 1 to i do
if d[j - 1] > d[j] then
begin
swapPoint(a[j - 1], a[j]);
Swap(d[j - 1], d[j]);
end;
end;

{************************************************* ******************************
function MakeMouseSplinePath(Sx, Sy, Ex, Ey, MaxDist, CtrlDist, CtrlVar: integer): TPointArray;
By: BenLand100and and modified by Ron
Description: Returns a random spline path starting at (Sx, Sy) Ending at (Ex, Ey)
Ending randomness of randX and randY
With no distance greater than MaxDist
Spacing control origins by CtrlDist With a randomness of CtrlVar
************************************************** *****************************}

function MakeMouseSplinePath(Sx, Sy, Ex, Ey, MaxDist, CtrlDist, CtrlVar:
Integer): TPointArray;
var
Controls, Path: TPointArray;
i, pts: Integer;
dist, ThetaInc, XInc, slope, b: Extended;
done: Boolean;
begin
dist := Sqrt(Pow((Sx - Ex), 2) + Pow((Sy - Ey), 2));
pts := Round(dist / CtrlDist);
if pts > 12 then
begin
pts := 12;
CtrlDist := Round(dist / pts);
end else if pts < 2 then
begin
pts := 1
CtrlDist := Round(dist / 2) - 5;
CtrlVar := CtrlDist;
end;
repeat
done := True;
if CtrlDist * pts > Round(dist) then
begin
done := False;
pts := pts - 1;
end;
until (done);
SetArrayLength(Controls, pts + 1);
Controls[0].x := Sx;
Controls[0].y := Sy;
if Ex - Sx <> 0 then
begin
slope := (Ey - Sy) / (Ex - Sx);
b := Sy - slope * Sx;
XInc := (Ex - Sx) / Pts;
for i := 1 to pts do
begin
Controls[i].x := Round((Sx + XInc * i) + (Random(CtrlVar * 2) - CtrlVar));
Controls[i].y := Round((slope * (Sx + XInc * i) + b) + (Random(CtrlVar * 2)
- CtrlVar));
end;
end else
begin
for i := 1 to pts do
begin
Controls[i].x := Random(CtrlVar * 2) - CtrlVar;
Controls[i].y := Sy + ((Ey - Sy) * i) + (Random(CtrlVar * 2) - CtrlVar);
end;
end;
Controls[i - 1].x := Ex;
Controls[i - 1].y := Ey;
if (Dist = 0) then Dist := 1.0
ThetaInc := (1.0 / (dist / 5.0));
Path := MakeSplinePath(Controls, ThetaInc);
Path := MidPoints(Path, MaxDist);
Result := Path;
end;

{************************************************* ******************************
function MMouse(dx, dy, RandX, RandY: Integer): Boolean;
By: BenLand100/Mutant Squirrle
Description: Moves the mouse along a spline to (dx, dy) with an ending randomness of RandX and RandY (If BenMouse=True (Default))
Global var BenMouse determines the behaviour of MMouse.
If an error occures the return value is false insted of crashing your script
************************************************** *****************************}

function MMouse(dx, dy, RandX, RandY: Integer): Boolean;
var
Path: TPointArray;
i, cx, cy, Lx, Ly, xx, yy, Dist, MidRX, MidRY: Integer;
Step, SlowDown: Extended;
begin
Result := True;
if (BenMouse) then
begin
try
MidRX := Round(RandX / 2);
MidRY := Round(RandY / 2);
dx := dx + MidRX + NormDist(MidRX);
dy := dy + MidRY + NormDist(MidRY);
if dx < 0 then dx := 0;
if dy < 0 then dy := 0;
GetMousePos(cx, cy)
if not ((Cx - dx = 0) and (Cy - dy = 0)) then
begin
Path := MakeMouseSplinePath(cx, cy, dx, dy, 7, 50, 40);
Lx := cx;
Ly := cy;
for i := 0 to GetArrayLength(Path) - 1 do
begin
MoveMouse(Path[i].x, Path[i].y);
Dist := Round(Sqrt((Path[i].x - dx) * (Path[i].x - dx) + (Path[i].y -
dy) * (Path[i].y - dy)));
if Dist < 50 then
begin
SlowDown := SlowDown + (0.05 * MouseSpeed);
end;
Wait(Round(((Random(2) + MouseSpeed) / 10) * Sqrt(Sqr(Path[i].x - Lx)
+ Sqr(Path[i].y - Ly)) + SlowDown));
Lx := Path[i].x;
Ly := Path[i].y;
end;
end;
MoveMouseSmooth(dx, dy);
except
WriteLn('Error in BenMouse');
WriteLn('Report: ' + IntToStr(cx) + ', ' + IntToStr(cy) + ' : ' +
IntToStr(dx) + ', ' + IntToStr(dy) + ' : ' + IntToStr(mousespeed) +
';');
end;
end else
begin // Start Mutant/RsN MMouse
step := 4;
xx := NormDist(RandX);
yy := NormDist(RandY);
dx := dx + xx;
dy := dy + yy;
GetMousePos(x, y);
repeat
if (Distance(x, y, dx, dy) < 100) then
if (not (Distance(x, y, dx, dy) = 0)) then
step := step - (10 / Distance(x, y, dx, dy));
if (step < 1) then
step := 1;
x := x + Round((dx - x) / step);
y := y + Round((dy - y) / step);
MoveMouse(x, y);
Wait(MouseSpeed);
until (Distance(x, y, dx, dy) = 0);
end;
end;



{************************************************* ******************************
procedure IdleTime(Time, Rand: integer; Gravity: extended);
By: BenLand100
Description: Randomly moves the mouse (Rand, and Gravity) for Time milliseconds
************************************************** *****************************}

procedure IdleTime(Time, Rand: Integer; Gravity: Extended);
var
H, W, Cx, Cy, i, n, St: Integer;
Controls, Path: TPointArray;
LastC, LastP: TPoint;
begin
St := GetSystemTime;
GetClientDimensions(W, H);
SetArrayLength(Controls, 4);
GetMousePos(Cx, Cy);
LastP.x := Cx;
LastP.y := Cy;
LastC.x := LastP.x + (Random(Rand * 2) - Rand)
LastC.y := LastP.y + (Random(Rand * 2) - Rand)
repeat
Controls[0].x := LastP.x;
Controls[0].y := LastP.y;
Controls[1].x := LastP.x + -(LastC.x - LastP.x);
Controls[1].y := LastP.y + -(LastC.y - lastP.y);
Controls[2].x := Controls[1].x + (Random(Rand * 2) - Rand);
Controls[2].y := Controls[1].y + (Random(Rand * 2) - Rand);
Controls[3].x := Controls[2].x + (Random(Rand * 2) - Rand);
Controls[3].x := Controls[3].x + Round(-(Controls[3].x - (W / 2)) *
(Gravity));
Controls[3].y := Controls[2].y + (Random(Rand * 2) - Rand);
Controls[3].y := Controls[3].y + Round(-(Controls[3].y - (H / 2)) *
(Gravity));
LastC.x := Controls[2].x;
LastC.y := Controls[2].y;
LastP.x := Controls[3].x;
LastP.y := Controls[3].y;
Path := MakeSplinePath(Controls, 0.01);
Path := MidPoints(Path, 5);
n := GetArrayLength(Path);
for i := 0 to n - 1 do
begin
MoveMouse(Path[i].x, Path[i].y);
Wait(Random(2) + 2);
if (GetSystemTime - St >= Time) then break
end;
until (GetSystemTime - St >= Time)
end;

{************************************************* ******************************
procedure IdleColor(Rand, Gravity, Color, Tol, X1, Y1, X2, Y2: Integer; Exists: Boolean);
By: BenLand100
Description: Randomly moves the mouse (Rand, and Gravity) either until a color (+ Tol) is in box X1, Y1, X2, Y2 (Exists = true), or is not (Exists = false)
************************************************** *****************************}

procedure IdleColor(Rand, Gravity, Color, tol, X1, Y1, X2, Y2: Integer; Exists:
Boolean);
var
H, W, Cx, Cy, i, n: Integer;
Controls, Path: TPointArray;
LastC, LastP: TPoint;
begin
GetClientDimensions(W, H);
SetArrayLength(Controls, 4);
GetMousePos(Cx, Cy);
LastP.x := Cx;
LastP.y := Cy;
LastC.x := LastP.x + (Random(Rand * 2) - Rand);
LastC.y := LastP.y + (Random(Rand * 2) - Rand);
repeat
Controls[0].x := LastP.x;
Controls[0].y := LastP.y;
Controls[1].x := LastP.x + -(LastC.x - LastP.x);
Controls[1].y := LastP.y + -(LastC.y - lastP.y);
Controls[2].x := Controls[1].x + (Random(Rand * 2) - Rand);
Controls[2].y := Controls[1].y + (Random(Rand * 2) - Rand);
Controls[3].x := Controls[2].x + (Random(Rand * 2) - Rand);
Controls[3].x := Controls[3].x + Round(-(Controls[3].x - (W / 2)) *
(Gravity));
Controls[3].y := Controls[2].y + (Random(Rand * 2) - Rand);
Controls[3].y := Controls[3].y + Round(-(Controls[3].y - (H / 2)) *
(Gravity));
LastC.x := Controls[2].x;
LastC.y := Controls[2].y;
LastP.x := Controls[3].x;
LastP.y := Controls[3].y;
Path := MakeSplinePath(Controls, 0.01);
Path := MidPoints(Path, 5);
n := GetArrayLength(Path);
for i := 0 to n - 1 do
begin
MoveMouse(Path[i].x, Path[i].y);
Wait(Random(2) + 2);
if (FindColorTolerance(Cx, Cy, Color, X1, Y1, X2, Y2, tol) = Exists) then
Break;
end;
until (FindColorTolerance(Cx, Cy, Color, X1, Y1, X2, Y2, tol) = Exists)
end;

{************************************************* ******************************
procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
By: Mutant Squirrle
Description: Moves then clicks mouse.
************************************************** *****************************}

procedure Mouse(mousex, mousey, ranx, rany: Integer; left: Boolean);
var
a, b, c: Integer;
begin
if (SRL_Smooth) then
begin
MMouse(mousex, mousey, ranx, rany);
Wait(60 + Random(30));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
end else
begin
MMouse(mousex, mousey, ranx, rany);
Wait(10 + Random(30));
GetMousePos(b, c);
ClickMouse(b, c, left);
end;
Wait(SRL_ClickTiming + Random(SRL_ClickTimingRan));
end;

{************************************************* ******************************
procedure SleepAndMoveMouse(Time: Integer);
By: RSN
Description: Waits for specified time and moves mouse around like bored human would.
************************************************** *****************************}

procedure SleepAndMoveMouse(Time: Integer);
var
Moving: Boolean;
mx, my: Integer;
x, y, xv, yv: Extended;
gx, gy: Extended;
T: Integer;
begin
GetMousePos(mx, my);
x := mx;
y := my;
if (Random(2) = 0) then
Moving := False
else
Moving := True;
gx := 130 + Random(500);
gy := 130 + Random(300);
T := GetTickCount;
repeat
Sleep(10);
if (Moving) then
begin
if (gx > x) then
xv := xv + 0.1
else
xv := xv - 0.1;
if (gy > y) then
yv := yv + 0.1
else
yv := yv - 0.1;
x := x + xv;
y := y + yv;
MoveMouse(Round(x), Round(y));
end;
if (Random(100) = 0) then
Moving := not Moving;
if (Random(30) = 0) then
begin
gx := 130 + Random(500);
gy := 130 + Random(300);
end;
until (Abs(GetTickCount - T) >= Time);
end;

{************************************************* ******************************
function Flag: Boolean;
By: PPLSUQBAWLZ/Odie533
Description: Waits while flag exists.
************************************************** *****************************}

function Flag: Boolean;
var
timeout: Integer;
begin
if (FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) then
begin
Result := True;
repeat
Wait(100);
timeout := timeout + 1;
until (not FindColor(x, y, 255, MMX1, MMY1, MMX2, MMY2)) or (timeout > 300);
end;
end;

{************************************************* ******************************
function FlagPresent: Boolean;
By: Mutant Squirrle
Description: T/F depending on flag exist.
************************************************** *****************************}

function FlagPresent: Boolean;
begin
Result := FindColor(x, y, 255, 559, 0, 735, 166);
end;

{************************************************* ******************************
function FlagDistance: Integer;
By: PPLSUQBAWLZ/Odie533
Description: Returns distance in pixels your char dot is from flag on mini-map
************************************************** *****************************}

function FlagDistance: Integer;
var
x, y: Integer;
begin
if (FindColor(x, y, 255, 559, 0, 735, 166)) then
Result := Distance(x + 2, y + 2, 648, 84);
end;

{************************************************* ******************************
procedure MouseFlag(cx, cy, rx, ry: Integer);
By: RsN
Description: Mouse and Flag combined into one easy
************************************************** *****************************}

procedure MouseFlag(cx, cy, rx, ry: Integer);
begin
Mouse(cx, cy, rx, ry, True);
Flag;
Wait(300 + Random(200));
end;


{************************************************* ******************************
procedure MouseFindFlag(ax, ay, xmod, ymod: Integer);
By: PPLSUQBAWLZ
Description: Checks Flag and clicks mouse in minimap until flag is found.
************************************************** *****************************}

procedure MouseFindFlag(ax, ay, xmod, ymod: Integer);
var
xx, yy, BreakOutTime: Integer;
begin
if (not (FlagPresent)) then
begin
xx := ax;
yy := ay;
MarkTime(BreakOutTime);
repeat
xx := xx + xmod;
yy := yy + ymod;
Mouse(xx, yy, 2, 2, True);
until (FlagPresent) or (xx < 570) or (xx > 725) or
(yy < 5) or (yy > 160) or (TimeFromMark(BreakOutTime) > 20000);
end;
end;

{************************************************* ******************************
procedure MouseFindNoFlag(ax, ay, xmod, ymod: Integer);
By: PPLSUQBAWLZ / WT-Fakawi
Description: Clicks mouse in minimap until flag is found
************************************************** *****************************}

procedure MouseFindNoFlag(ax, ay, xmod, ymod: Integer);
var
xx, yy: Integer;
begin
xx := ax;
yy := ay;
repeat
xx := xx + xmod;
yy := yy + ymod;
Mouse(xx, yy, 0, 0, True);
until (FlagPresent) or (xx < 570) or (xx > 725) or (yy < 5) or (yy > 160);
end;

{************************************************* ******************************
procedure MouseUntilFlag(xmod, ymod: Integer);
By:
Description: Clicks mouse in minimap until flag is found.
************************************************** *****************************}

procedure MouseUntilFlag(xmod, ymod: Integer);
var
BreakOutTime: Integer;
begin
MarkTime(BreakOutTime);
repeat
x := x + xmod;
y := y + ymod;
Mouse(x, y, 0, 0, True);
until (FlagPresent) or (x < 570) or (x > 725) or
(y < 5) or (y > 160) or (TimeFromMark(BreakOutTime) > 20000);
end;


{************************************************* ******************************
function HumanCircleFlag(Dist: Integer): Boolean;
By: Wizzup? and WT-Fakawi.
Description: Draws Circle around MMcentre and returns True if Flag is within distance.
************************************************** *****************************}

function HumanCircleFlag(Dist: Integer): Boolean;
var
i, X1, Y1: Integer;
begin
for i := 0 to 360 do
begin
X1 := Round(Dist * Sin(i * Pi / 180)) + 648;
Y1 := Round(-Dist * Cos(i * Pi / 180)) + 80;
if FindColor(x, y, 255, X1, Y1, X1 + 1, Y1 + 1) then
begin
Result := True;
Break;
end;
end;
end;

{************************************************* ******************************
procedure FFlag(Distance: Integer);
By: Wizzup? / WT-Fakawi.
Description: Waits until Flag is within "Distance" distance.
************************************************** *****************************}

procedure FFlag(Distance: Integer);
var
XK, YK, XL, YL: Integer;
var
T1, T2: Extended;
begin
T1 := GetTickCount;
repeat
T2 := GetTickCount;
Wait(100);
if HumanCircleFlag(Distance) then
Break;
Wait(100);
if T2 - T1 > 30000 then
begin
if FindColor(XL, YL, 255, MMX1, MMY1, MMX2, MMY2) then
MouseFindFlag(XL, YL, 1, 1)
else Mouse(MMCX, MMCY, 0, 0, True);
Break;
end;
if Random(20) = 1 then IdleTime(500, 1000, 0.01);
until (not FindColor(XK, YK, 255, MMX1, MMY1, MMX2, MMY2));
end;

{************************************************* ******************************
procedure ChatsOff;
By: RsN
Description: Sets all Chats to off.
************************************************** *****************************}

procedure ChatsOff;
var
x, y, setx, sety, i: Integer;
begin
for i := 0 to 2 do
begin
setx := 55 + (i * 135);
sety := 490;
while (FindColor(x, y, 16776960, setx - 10, sety - 10, setx + 10, sety + 10))
do
Mouse(x, y, 5, 5, True);
while (FindColor(x, y, 65280, setx - 10, sety - 10, setx + 10, sety + 10))
do
Mouse(x, y, 5, 5, True);
while (FindColor(x, y, 65535, setx - 10, sety - 10, setx + 10, sety + 10))
do
Mouse(x, y, 5, 5, True);
end;
end;

{************************************************* ******************************
procedure SetChat(state: String; chat: Integer);
By: RSN and modified by Ron/Cheesehunk
Description: Sets all Chats to state.
state: 'on', 'hide', 'friends', 'off'
chat: 1:Public, 2:Private, 3:Irade
************************************************** *****************************}

procedure SetChat(state: string; chat: Integer);
var
x, y, setx, sety, C: Integer;
begin
setx := 55 + ((chat - 1) * 135);
sety := 490;
State := Lowercase(State);
case State of
'hide' :
if chat = 1 then
begin
while not(FindColor(x, y, 16776960, setx - 10, sety - 10, setx + 10, sety + 10))
do
begin
if (C > 9) then Break;
Mouse(setx, sety, 5, 5, True);
Wait(900 + Random(200));
C := C + 1;
end;
end else
Writeln('You can only set Public Chat to hide!');
'on' :
while not(FindColor(x, y, 65280, setx - 10, sety - 10, setx + 10, sety + 10))
do
begin
if (C > 9) then Break;
Mouse(setx, sety, 5, 5, True);
Wait(900 + Random(200));
C := C + 1;
end;
'friends' :
while not(FindColor(x, y, 65535, setx - 10, sety - 10, setx + 10, sety + 10))
do
begin
if (C > 9) then
Break;
Mouse(setx, sety, 5, 5, True);
Wait(900 + Random(200));
C := C + 1;
end;
'off' :
while not(FindColor(x, y, 255, setx - 10, sety - 10, setx + 10, sety + 10))
do
begin
if (C > 9) then Break;
Mouse(setx, sety, 5, 5, True);
Wait(900 + Random(200));
C := C + 1;
end;
else
WriteLn('SetChat - Incorrect State! Possible values: Hide, On, Friends, Off');
end;
end;

{************************************************* ******************************
procedure MouseBox(xs, ys, xe, ye: Integer; click: Integer);
By: XxKanexX
Description: Moves mouse into a random position in the box. Clicks if told to.
************************************************** *****************************}

procedure MouseBox(xs, ys, xe, ye: Integer; click: Integer);
var
a, b: Integer;
begin
a := Max(xs, xe) - Min(xs, xe);
b := Max(ys, ye) - Min(ys, ye);
a := Random(a);
b := Random(b);
MMouse(xs + a, ys + b, 0, 0);
if (click <> 0) then
case click of
1:
Mouse(xs + a, ys + b, 0, 0, True);
2:
Mouse(xs + a, ys + b, 0, 0, False);
end;
end;


{************************************************* ******************************
procedure Drag(x1, y1, rx1, ry1, x2, y2, rx2, ry2: Integer; left: Boolean);
By: Zup
Description: Drags mouse from (x1, y1) to (x2, y2) with randoms at each point.
************************************************** *****************************}

procedure Drag(x1, y1, rx1, ry1, x2, y2, rx2, ry2: Integer; left: Boolean);
var
x, y: Integer;
begin
MMouse(x1, y1, rx1, ry1);
GetMousePos(x, y);
HoldMouse(x, y, left);
Wait(300 + Random(400));
MMouse(x2, y2, rx2, ry2);
Wait(50 + Random(100));
GetMousePos(x, y);
ReleaseMouse(x, y, left);
Wait(500 + Random(500));
end;

{************************************************* ******************************
procedure MouseBack(cx, cy, RanX, RanY, RandomEnd, PercentReturn, Click: Integer);
By: phantombmx
Description: Like MMouse or Mouse but will fall back on the starting point.
RandomEnd is a random for the total ending point, 50 is good. PercentReturn is the
percentage that it will fall back, 50-70 is good. 0 for no click, 1 for left, 2 for right.
************************************************** *****************************}

procedure MouseBack(cx, cy, RanX, RanY, RandomEnd, PercentReturn, Click:
Integer);
var
fx1, fx2, fy1, fy2: Integer;
perc: Extended;
begin
perc := StrToFloat(IntToStr(PercentReturn)) / 100
GetMousePos(fx1, fy1);
case Click of
0: MMouse(cx, cy, RanX, RanY);
1: Mouse(cx, cy, RanX, RanY, True);
2: Mouse(cx, cy, RanX, RanY, False);
end;
GetMousePos(fx2, fy2);
if (Min(fx1, fx2) = fx1) then
fx1 := fx2 - Trunc((fx2 - fx1) * (perc))
else
fx1 := fx1 + Trunc((fx1 - fx2) * (perc));
if (Min(fy1, fy2) = fy1) then
fy1 := fy2 - Trunc((fy2 - fy1) * (perc))
else
fy1 := fy1 + Trunc((fy1 - fy2) * (perc));
case Random(2) of
0: MMouse(fx1 - Random(RandomEnd), fy1 - Random(RandomEnd), 0, 0);
1: MMouse(fx1, fy1, RandomEnd, RandomEnd);
end;
end;


there's my "MouseFlag.scar"

if I run "MouseFlag" I get this error:

Line 159: [Error] (159:9): Unknown identifier 'MakeSplinePath' in script C:\Documents and Settings\Dad\Desktop\Junk\srl\srl\core\MouseFlag.s car


Line 148-160


begin
for i := 1 to pts do
begin
Controls[i].x := Random(CtrlVar * 2) - CtrlVar;
Controls[i].y := Sy + ((Ey - Sy) * i) + (Random(CtrlVar * 2) - CtrlVar);
end;
end;
Controls[i - 1].x := Ex;
Controls[i - 1].y := Ey;
if (Dist = 0) then Dist := 1.0
ThetaInc := (1.0 / (dist / 5.0));
Path := MakeSplinePath(Controls, ThetaInc);
Path := MidPoints(Path, MaxDist);
Result := Path;
end;

Anyone know how to fix? anyone need more info to know how to fix?