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

Error: Exception: Access violation at line 86


TsterT

2011-12-21 06:12:54

I keep getting an error here:

function GetColor(x, y: Integer): Integer;
begin
[highlight]result:= SmartGetColor(x, y);[/highlight]
end;
When testing my script. Every other script I use that uses SMART runs perfectly fine. So I have no clue why mine doesn't.

Code from my script:

{$i SRL/SRL/misc/smart.scar}
{$i SRL/SRL.scar}
{$i SRL/SRL/skill/prayer.scar}
{$i SRL/SRL/misc/stats.simba}

I'm going to bed at the moment, so sorry if I don't respond fast. I tried searching through the forums, yet nothing did any good.

Thanks in advance,
TsterT

Narcle

2011-12-21 06:19:29

Close Simba, check for Simba in process close all of those.

Restart try again.

If that doesn't work restart computer Java probably messed up.

YoHoJo

2011-12-21 06:21:17

Very odd. So all other smart scripts work but not yours!?
Try looking how other scripts (in which SMART works) include smart.
It might look like {define smart} or something like that. And use that instead.
NORMALLY this error appears when you don't have java installed but obviously you do hmm

Narcle

2011-12-21 06:24:16

Oh check to see what where your looking, if its out of bounds of client it might crash it too.

TsterT

2011-12-21 06:44:13

I restarted my computer, still no luck. Used {$DEFINE SMART} in place of {$i SRL/SRL/misc/smart.scar}, still no luck. All the files I'm using are available in the Include folder.

For the hell of it, here's my what I've gotten done in my script so far. It has to be something else messing it up, considering other scripts that actually do work are implementing SMART the same way as I.

Smidqe

2011-12-21 11:40:17

Just looked at your code and found out that you call SetupSRL twice, when you should only do it once. Just do what I've instructed here below and it should be all good.

Remove SetupSRL from here
procedure startUp;
begin
MouseSpeed := 16+random(3)
if not LoggedIn then
SetupSRL; //remove this
declarePlayers;
Disguise(ScriptName+' v'+Version);
Loginplayer;
end;

and move the SetupSRL to highest.
begin
//move SetupSRL on your mainloop to here
startUp;
setupSRL;
ClearDebug;
ActivateClient;
Wait(1000 + Random(500));
repeat
pickUp;
until(false);
end.

TsterT

2011-12-21 15:05:11

From: Smidqe
Just looked at your code and found out that you call SetupSRL twice, when you should only do it once. Just do what I've instructed here below and it should be all good.

Remove SetupSRL from here
procedure startUp;
begin
MouseSpeed := 16+random(3)
if not LoggedIn then
SetupSRL; //remove this
declarePlayers;
Disguise(ScriptName+' v'+Version);
Loginplayer;
end;

and move the SetupSRL to highest.
begin
//move SetupSRL on your mainloop to here
startUp;
setupSRL;
ClearDebug;
ActivateClient;
Wait(1000 + Random(500));
repeat
pickUp;
until(false);
end.

Hah, didn't even notice that. That seemed to do the trick. Thanks man.