SRL Archive - Bugs

Not Compiling SRL 4


Sir R. M8gic1an

2010-06-08 13:36:19

I'm not testing out Simba and ran into this when I tried to run CompileSRL.scar..

[Error] D:\Simba\Simba\Includes\SRL\SRL\Misc\Path.scar(177:33): Type mismatch at line 176

line:
if IsMouseButtonDown(False) then

[php]
{*******************************************************************************
procedure PathRecorder(StartPath: Integer);
By: WT-Fakawi
Description: Simple PathRecorder.
Usage: Enter StartPath.
- Click RightMouse Button for SubPoints
- Now hover Mouse over MainPoint and hit Q
- Copy Debug printout to your script.
- Choose Subpoints carefully. Upto 9 clicks are allowed,
but 4 Subpoints should well be sufficiant.
*******************************************************************************}
procedure PathRecorder(StartPath: Integer);
var
i, CurrentPath, SubPointCounter, x, y: Integer;
begin
CurrentPath := StartPath;
repeat
Wait(100);
if IsMouseButtonDown(False) then
begin
GetMousePos(x, y);
Path[CurrentPath].SubPoints[SubPointCounter].x := x;
Path[CurrentPath].SubPoints[SubPointCounter].y := y;
repeat
wait(16);
until not IsMouseButtonDown(False);
SubPointCounter := SubPointCounter + 1;
end;

if IsKeyDown('q') then
begin
GetMousePos(x, y);
Path[CurrentPath].MainPoint.x := x;
Path[CurrentPath].MainPoint.y := y;
repeat
until not IsKeyDown('q');
writeln('Path[' + IntToStr(CurrentPath) + '].Mainpoint.x:=' + IntToStr(Path[CurrentPath].MainPoint.x) + ';');
writeln('Path[' + IntToStr(CurrentPath) + '].Mainpoint.y:=' + IntToStr(Path[CurrentPath].MainPoint.y) + ';');
for i := 0 to SubPointCounter - 1 do
begin
writeln('Path[' + IntToStr(CurrentPath) + '].Subpoints[' + IntToStr(i) + '].x:=' + IntToStr(Path[CurrentPath].Subpoints.x) + ';');
writeln('Path[' + IntToStr(CurrentPath) + '].Subpoints[' + IntToStr(i) + '].y:=' + IntToStr(Path[CurrentPath].Subpoints.y) + ';');
end;
SubPointCounter := 0;
CurrentPath := CurrentPath + 1;
end;
until False;
end;
[/php]

~RM

Sir R. M8gic1an

2010-06-08 15:14:13

Nevermind this..

I just ran SetupSRL in Simba the propper way. Compiled just fine. Not sure what the cause of this was, except maybe for the fact that CompileSRL uses {.include} rather than {$i } ?

~RM

Wizzup?

2010-06-08 16:41:11

Well, AFAIK IsMouseButtonDown different in Simba as it needs an Integer rather than a boolean. (A mouse has more than two buttons)
If you change it to an int, it should work.