Log in

View Full Version : Line 85:[Error] (90:46): Invalid number of parameters in script C:\Program Files\SCAR



brad734
05-05-2009, 11:59 AM
ok every time i run a script with smart in it i get this


Line 85: [Error] (90:46): Invalid number of parameters in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Misc/SMART.scar

heres my smart.scar as it says the error is with above.


function IsKeyDown(C:Char): Boolean;

begin
Result := SmartIsKeyDown(ord(c));
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('.',ExtractF ileName(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;

I'm using scar 3.15b, Rev #32 and i have reflection. also Embedded smart.dll v4.4

Might be a nooby question but please forgive me :D
Could you post what i must fix in smart.scar, Give me a updated smart.scar download link or pm/email me some help for this.

MSN: hoodb0ss@hotmail.com

Thanks

TRiLeZ
05-05-2009, 12:28 PM
I had that error too and my smart.scar and dll were up to date (with 4.4)
Version 4.3 worked fine for me when that happened.
Maybe try version 4.3.
I dont know the problem because a while after, I tryed 4.4 again and it worked so :\

Mystic
05-06-2009, 06:37 AM
ok every time i run a script with smart in it i get this


Line 85: [Error] (90:46): Invalid number of parameters in script C:\Program Files\SCAR 3.15\includes\SRL/SRL/Misc/SMART.scar

heres my smart.scar as it says the error is with above.


function IsKeyDown(C:Char): Boolean;

begin
Result := SmartIsKeyDown(ord(c));
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('.',ExtractF ileName(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;

I'm using scar 3.15b, Rev #32 and i have reflection. also Embedded smart.dll v4.4

Might be a nooby question but please forgive me :D
Could you post what i must fix in smart.scar, Give me a updated smart.scar download link or pm/email me some help for this.

MSN: hoodb0ss@hotmail.com

Thanks

You should get Scar 3.20, your rev is fine. It's not your SMART.scar, cause I am using the same one, and it works for me. What is line 85?, and if you can.. What script are you trying to run? I'll help as best I can :)

Dark Arcana
05-06-2009, 06:00 PM
In the script you are using, I think it has

{.Include SRL/SRL.Scar}


before


{. Include SRL/SRL/Misc/Smart.Scar}


So Instead of this:

{. Include SRL/SRL.Scar}
{. Include SRL/SRL/Misc/Smart.Scar}


Change it into this:

{. Include SRL/SRL/Misc/Smart.Scar}
{. Include SRL/SRL.Scar}