SRL Archive - S.M.A.R.T.

Smart Error!


faster789

2008-03-23 15:09:30

ok…i keep gettin this error!!please anyone help me! :

[Runtime Error] : Exception: Access violation at address 029810AB in module 'Embedded SMART.dll'. Read of address 000006DC in line 47 in script C:\Documents and Settings\Owner\My Documents\Grade 7\SCAR 3.15\includes\SRL/SRL/misc/SMART.scar

and btw this is my script…i made it compatible wid SMART didnt I?? if yes why do i keep gettin the error?

program Miner;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}

var x,y: integer;

const
SmartWorld = 126; // what world smart uses
Signed = True;

LoadsPerPlayer= 2; // how many loads per player?
WaitPerRock= 5000; //how many seconds to waiter between rocks
rockcolor1= 5274794; // 1 color of the rock
rockcolor2= 4944798; // 2nd color of the rock
rockcolor3= 4879005; // 3rd color of the rock

procedure DeclarePlayers;
begin
HowManyPlayers :=1; // how many players do you want
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:=0
Players[0].Name := 'Username'; //Character Name
Players[0].Pass := 'Password'; //Character Pass
Players[0].Nick := 'nick'; //Nickname 3 - 4 Letter's of char name
Players[0].Active := True; //true if you want this player to be ran in the script false if you dont want it to run
end;

procedure SetupSmart;
begin
SmartSetupEx(SmartWorld, false, Signed);
ClearDebug;
WriteLn('Setting up Smart... Please Hold...');
Wait(10000 + random(5000));
SetTargetDC(SmartGetDC);
While not(SmartReady) do Wait(100);
end;



Procedure Myrandom;
begin

FindNormalRandoms;
FindLamp('Mining');

if(FindFight)then
RunAway('N', True,1,15000);
end;

procedure antiban;
begin
if(not(LoggedIn)) then Exit;
case Random(30) of
1: RandomRClick;
2: HoverSkill('Mining', False);
3: RandomMovement;
4: BoredHuman;
5: AlmostLogout;
6: DoEmote(400 + Random(90));
end;
end;

procedure Minedarock;

var x, y, MyMark: integer;

begin
if(not(LoggedIn))then
Exit;
Marktime(Mymark);
MakeCompass('N');
repeat
if FindObjCustom(x, y, ['Min', 'ine'], [rockcolor1, rockcolor2, rockcolor3], 7)
then
begin
MMouse(x,y,1,1);
Wait(500+ (random(150)));
writeln('found rock');
if ChooseOption('ine') then
begin
Wait(WaitPerRock);
antiban;
Myrandom;
exit;
end;
end;
if TimeFromMark(MyMark) > (2 * 60 * 100) then
begin
Logout;
Exit;
end;
until false;

end;


procedure Drop;
begin
if Not(LoggedIn) then exit;
GameTab(4);
for x := 3 to 28 do
Begin
if Random(101) < 3 then
Begin
MouseItem(x, true);
MouseItem(x + 1, true);
end;
MouseItem(x, false);
ChooseOption('rop');
end;
end;

begin
if (not(LoggedIn)) then LoginPlayer;
SetupSmart;
SetupSRL;
DeclarePlayers;
if LoggedIn then Logout;
LoginPlayer;
repeat
Minedarock;
if InvFull then
begin
Drop;
Inc(Players[CurrentPlayer].Banked);
if Players[CurrentPlayer].Banked mod LoadsPerPlayer = 0 then
begin
NextPlayer(True);
end;
end;
if not Loggedin then NextPlayer(False);

until False;
end.

Harry

2008-03-23 15:10:57

Do a clean DL of SRL :)

mixster

2008-03-23 15:12:46

Try moving the 'if (not(LoggedIn)) then LoginPlayer;' (the one right at the start of the mainloop) to after the setups or just remove it as you have it logout if the user is logged in a bit later anyway. The error would be caused by Scar trying to check a colour but can't as SMART isn't setup, so it tries to do it to the client and fails miserably or something to that extent.

faster789

2008-03-23 15:19:25

From: Hy71194
Do a clean DL of SRL :)

lol thx..but i think its workin now…thx for all your help! hehe that doesnt mean i wont be askin you questionz after:p :D

faster789

2008-03-23 15:21:56

From: mixster05
Try moving the 'if (not(LoggedIn)) then LoginPlayer;' (the one right at the start of the mainloop) to after the setups or just remove it as you have it logout if the user is logged in a bit later anyway. The error would be caused by Scar trying to check a colour but can't as SMART isn't setup, so it tries to do it to the client and fails miserably or something to that extent.


thanks a ton! it works nowwww yayyy :D

mixster

2008-03-24 10:18:31

You don't have to double post next time, but you're welcome (press the little green thing to the right of quote on all posts you want to quote, then click new reply and both will be quoted - it's amazing!).

faster789

2008-03-24 10:26:25

From: mixster05
You don't have to double post next time, but you're welcome (press the little green thing to the right of quote on all posts you want to quote, then click new reply and both will be quoted - it's amazing!).

lol kk thx..

n3ss3s

2008-03-24 13:18:39

I can't believe it works now, because none of you told him that he needs

SetTargetDC(SmartGetDC);

mixster

2008-03-25 12:06:13

He's got it, check near the top of the script for the 'SetupSmart' procedure ;)