SRL Archive - S.M.A.R.T. Bugs and Improvements.

Runtime Error


goider

2007-11-25 17:11:06

i have gotten the error
[Runtime Error] : Exception: Access violation at address 021310AB in module 'Embedded SMART.dll'. Read of address 06DD8120 in line 38 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/Misc/Smart.scar

several times in the past few days, any ideas on fixes?

Psychor

2007-11-25 19:28:30

Mostly when i get an Access violation i need to reboot my pc and it's good to go

goider

2007-11-25 20:02:00

yeah, that is what i do, but im looking for a permenanent fix, hopefully banland sees this.

BenLand100

2007-11-25 21:20:41

I doubt its an error as much as its a problem with setting it up. However, what's on line 38?

Bobarkinator

2007-11-25 22:09:57

How about you tell us what address 021310AB is ;)

goider

2007-11-25 22:47:38

From: Bobarkinator
How about you tell us what address 021310AB is ;)


i'll find that out when its not 11:00 on a school night

and here is he contents of my SRL folder under misc.

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
SmartReleaseKey(key);
end;

procedure KeyDown(key: Byte);
begin
SmartHoldKey(key);
end;

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

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

[I]function GetColor(x, y: Integer): Integer;
begin
result:= SmartGetColor(x, y); <<<<38
end;[/I]

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 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;

procedure SmartSetupEx(worldnumber: integer; hiDetail, signed: 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, hiDetail, signed);
end;

procedure StartSmart(worldnumber: integer; hiDetail, signed: boolean);
begin
SmartSetupEx(worldnumber, hiDetail, signed);
repeat
wait(100);
until(SmartReady);
SetTargetDC(SmartGetDC);
end;

EDIT: okay, so it does look familiar, it seems there may be some sort of disconnect beteween the files/server. i only vaguely remember this haoppening somtimes with my antrix server for WoW (it happened with MySQL when it dc'd with internet or couldn't get a file fast enough…

Bobarkinator

2007-11-25 22:56:07

No, that was at Ben, the address is in the dll.

goider

2007-11-26 17:22:37

lol, okay good :) i felt put on the spot.

BenLand100

2007-11-27 01:19:34

From: Bobarkinator
No, that was at Ben, the address is in the dll.

Yea, cause I look at the machine code for every dll I write and memorize where various function calls are ;) Just so happens that that address is within SmartGetColor (big surprise, thats why I wanted to know whats on line 38 :p) and the problem is happening on an read rather than a write meaning that you are trying to get a color that is not on the RS screen. So, possibly find what is trying to get a bad-positioned color and change it ;) Also, Smart is not always loaded into the same address space, based on other plugins and system wide dlls you have. So knowing whats at each address does no good since I wouldn't know where the start of the dll address space is. :rolleyes:

goider

2007-11-27 18:07:34

errr, so no real fix and just have to go on living with my guildminer crashing every hour or so?

Nose Smasher

2009-06-17 22:53:41

the problem is happening on an read rather than a write meaning that you are trying to get a color that is not on the RS screen. So, possibly find what is trying to get a bad-positioned color and change it ;)


Assuming he meant its in your script ;)

Sir R. M8gic1an

2009-06-18 01:47:30

closed. way old.

~RM