SRL Archive - S.M.A.R.T. Questions and Answers.

Help Smart Error


Alfreci

2008-08-09 15:57:06

ok i have has so much trouble with smart latley so i uninstalled any thing that had to do with scar and the program file. After that i reinstalled the svn, checkout etc. i ran smart it self to see if it would compile. instead of the line 4 error i get [Error] (107:1): Unexpected end of file.

srl revision 20
scar 3.15b
Subversion.
is anything missing?


this is the scar i am using.



function IsKeyDown(C:Char): Boolean;

begin
Result := SmartIsKeyDown(ord©);
end;

procedure MoveMouse(x, y: Integer);
begin
SmartMoveMouse(x, y);
end;

procedure HoldMouse(x, y: Integer; left: Boolean);
begin
SmartHoldMouse(x, y, left);
end;

procedure ReleaseMouse(x, y: Integer; left: Boolean);
begin
SmartReleaseMouse(x, y, left);
end;

procedure KeyUp(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartReleaseKey(key);
end;

procedure KeyDown(key: Byte);
begin
If Key = 13 Then
Key := 10;
SmartHoldKey(key);
end;

procedure SendKeys(S: String);
begin
SmartSendKeys(S);
end;

procedure GetMousePos(var x, y: Integer);
begin
SmartGetMousePos(x, y);
end;

function GetColor(x, y: Integer): Integer;
begin
result:= SmartGetColor(x, y);
end;

procedure SmartSetTarget;
var
Smart_Bitmap: Integer;
begin
Smart_Bitmap:= BitmapFromString(765,503,'');
GetBitmapCanvas(Smart_Bitmap).Handle:= SmartGetDC;
SetTargetBitmap(Smart_Bitmap);
FreeBitmap(Smart_Bitmap);
end;

function FindWindow(Title: String): Boolean;
begin
result:= true;
end;

procedure ActivateClient;
begin
end;

function FindWindowBySize(Width, Height: Integer): Boolean;
begin
result:= true;
end;

procedure SmartSetupEx(worldnumber: integer; safe, signed, superdetail: boolean);
var
prefix: string;
begin
prefix := ReadINI('World' + IntToStr(worldnumber), 'Prefix', AppPath + 'includes\SRL\SCSS\worlds.ini');
if(prefix = '')then
begin
writeln('Invalid world number or corrupted world list. Please review your settings');
TerminateScript;
end;
SmartSetup(prefix, safe, signed, superDetail);
end;

Procedure SaveScreenshot(s : string);
var
TempBMP : integer;
TempS : String;
begin;
Temps := s;
While FileExists(Temps) do
begin;
Temps := ExtractFilePath(s) + Copy(ExtractFileName(Temps),1,LastPos('.',ExtractFileName(Temps))-1) + '2' + ExtractFileExt(s);
Writeln(Temps);
end;
TempBMP := BitmapFromString(765,503,'');
Try
CopyClientToBitmap(TempBMP,0,0,765,503);
SaveBitmap(TempBMP, Temps);
Except
end;
FreeBitmap(TempBMP);
end;

Shuttleu

2008-08-09 16:00:14

what script or file were you trying to run?

~shut

Alfreci

2008-08-09 16:02:52

im running smart itself. yesterday it wouldnt run anything that used smart cuase of the line 4 error. now i am trying it by it self

Shuttleu

2008-08-09 16:08:21

thats because your not ment to run smart.scar
your ment to include smart in your script

program RunSmart;
{.include srl/srl/misc/smart.scar}

begin
SmartSetupEx(123, True, True, False);
end.
also please use scar tags

~shut

Alfreci

2008-08-09 16:11:36

ok, problem solved. sorry about the confusion.
also, i was trying to use BH's willow cutter

CLOSED