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

I think my SMART file is messed up


vamos124

2009-03-30 13:25:12

I try running RM Extreme Fisher on smart, but an error comes up with the actual SMART script. I know i can use the auto with no smart but i really need smart. Here is my SMART script

[PHP]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; members, 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('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)));
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;[/PHP]

and my Debug box:

[PHP]SRL Compiled in 2000 msec
05:44:06 PM - Loading DTMs
Players: 1; Starting: kahan124
[Runtime Error] : Exception: Access violation at address 6720456E in module 'Embedded_SMART.dll'. Read of address 00000000 in line 85 in script C:\Program Files\SCAR 3.15\includes\srl/srl/misc/Smart.scar[/PHP]

Please help
Thanks

impiwimpi

2009-03-30 13:37:03

I think its because you've got an outdated embedded_smart.dll
Search v4.2 and replace the old one with it…

vamos124

2009-03-30 14:33:17

Okay I updated my SMART but now another error comes. Seems like wherever i look theres a bloody error.

Once again, Script:
[PHP]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;[/PHP]

and Debug…
[PHP]Loaded all chars. (NPCChars, TradeChars, SmallChars, StatChars, UpChars)
Failed when compiling
Line 85: [Error] (148:46): Invalid number of parameters in script C:\Program Files\SCAR 3.15\includes\srl/srl/misc/Smart.scar[/PHP]

Can somebody please just post me their SMART file? Ill give rep if it works.

Colluci

2009-03-30 14:49:07


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; members, 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('http://'+prefix+'.runescape.com/', 'plugin.js?param=o0,a' + IntToStr((Integer(not(Signed)) + 1) * Integer(not((SuperDetail and Signed)))) + ',m' + IntToStr(Integer(Members)));
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;

Btw can you please post the script you're using or the part where it calls SMART?