Silent
07-10-2011, 06:05 AM
So I finally started making my first script. It's going to be a smither, but I haven't even gotten very far and I'm getting an Access Violation. I searched the forums before posting this, but I didn't find anything that helped. :(
Here is my code:
program GeneralSmith;
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
{$i SRL/SRL/core/SPS/SPS.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //Set total amount of players
NumberOfPlayers(HowManyPlayers); // SRL procedure. Don't touch.
CurrentPlayer := 0; // Player to start with, should always be 0.
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;
procedure WalkingFrom(SPS_WalkPath: TPointArray);
var
BankToanvil: TPointArray;
BankToGe: TPointArray;
begin
SPS_Areas :=['10_2', '10_3'];
BankToAnvil := [Point(4378, 1360), Point(4374, 1398)];
BankToGe:= [Point(4378, 1360), Point(4371, 1315),
Point(4333, 1302), Point(4304, 1283),
Point(4285, 1256), Point(4285, 1200),
Point(4281, 1165), Point(4289, 1153)];
begin
case WalkingFrom(SPS_WalkPath) of
BankToAnvil:
begin
Writeln('To the Anvil!');
SPS_WalkPath(BankToAnvil);
Writeln('Made it...');
else
Writeln('Blast walking failed.')
Exit;
end
end
end
begin
// Setting up SMART
Smart_Server := 152;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers; // Calling players
LoginPlayer; // Logging in...
end.
I realize I'm probably just using something wrong, but I'm still pretty new to this. The error I get in the debug is simply:
Exception in Script: Access violation
Help? If it's just a stupid mistake I made feel free to point it out quickly. I don't mind if people are harsh, I just want to figure this out and get it resolved.
Here is my code:
program GeneralSmith;
{$i srl/srl/misc/smart.scar}
{$i srl/srl.scar}
{$i SRL/SRL/core/SPS/SPS.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1; //Set total amount of players
NumberOfPlayers(HowManyPlayers); // SRL procedure. Don't touch.
CurrentPlayer := 0; // Player to start with, should always be 0.
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
end;
procedure WalkingFrom(SPS_WalkPath: TPointArray);
var
BankToanvil: TPointArray;
BankToGe: TPointArray;
begin
SPS_Areas :=['10_2', '10_3'];
BankToAnvil := [Point(4378, 1360), Point(4374, 1398)];
BankToGe:= [Point(4378, 1360), Point(4371, 1315),
Point(4333, 1302), Point(4304, 1283),
Point(4285, 1256), Point(4285, 1200),
Point(4281, 1165), Point(4289, 1153)];
begin
case WalkingFrom(SPS_WalkPath) of
BankToAnvil:
begin
Writeln('To the Anvil!');
SPS_WalkPath(BankToAnvil);
Writeln('Made it...');
else
Writeln('Blast walking failed.')
Exit;
end
end
end
begin
// Setting up SMART
Smart_Server := 152;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers; // Calling players
LoginPlayer; // Logging in...
end.
I realize I'm probably just using something wrong, but I'm still pretty new to this. The error I get in the debug is simply:
Exception in Script: Access violation
Help? If it's just a stupid mistake I made feel free to point it out quickly. I don't mind if people are harsh, I just want to figure this out and get it resolved.