SRL Archive - General Botting Help

Setting up Smart 8 Error


ryoshiggy

2014-07-09 15:27:49

I keep getting this error:
Exception in Script: Unknown declaration "HowManyPlayers" at line 7, column 3

I used the official tutorial for smart8.

I'm supposed to type in this code at the end of the process:
program TestScript;
{$DEFINE SMART8} //Using SMART8 Instead of SMART is very important
{$I SRL/SRL.Simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
end;

procedure SetupSmartClient;
begin
SRL_SixHourFix := True;
SMART_FixSpeed := True;

ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end;

begin
SetupSmartClient;

WriteLn('Finished, exiting …');
end.

What am I doing wrong? Please help!

Turpinator

2014-07-09 16:28:09

From: ryoshiggy
I keep getting this error:
Exception in Script: Unknown declaration "HowManyPlayers" at line 7, column 3

I used the official tutorial for smart8.

I'm supposed to type in this code at the end of the process:
program TestScript;
{$DEFINE SMART8} //Using SMART8 Instead of SMART is very important
{$I SRL/SRL.Simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := ''; // Player username
Pass := ''; // Player password
Active := True;
end;
end;

procedure SetupSmartClient;
begin
SRL_SixHourFix := True;
SMART_FixSpeed := True;

ClearDebug;
SetupSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;
end;

begin
SetupSmartClient;

WriteLn('Finished, exiting …');
end.

What am I doing wrong? Please help!


SMART8 and whatever is no longer used. the tutorial you are using is out of date.

ryoshiggy

2014-07-09 16:49:18

then where can i get an up to date tutorial?

KeepBotting

2014-07-09 22:47:07

From: ryoshiggy
then where can i get an up to date tutorial?

In the tutorials section, for SRL-6 try The Mayor's tutorial, for OSR I'm not sure

Lucidity

2014-07-10 00:54:26

That is srl-5, try finding something related to srl-6 like KeepBotting mentioned

Flight

2014-07-10 01:34:02

I think first you should specify if this is for OSR or RS3. If it's for OSR try this instead:

program TestScript;
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

procedure declarePlayers();
var
HowManyPlayers : Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Nick := '';
LampSkill := SKILL_HERBLORE;
Active := True;
end;
end;

begin
clearDebug();
declarePlayers();
setupSRL();
loginPlayer();
end.

For RS3 (SRL-6) I have no idea how you'd do a test script.

KeepBotting

2014-07-10 09:28:34

From: Flight
I think first you should specify if this is for OSR or RS3. If it's for OSR try this instead:

program TestScript;
{$DEFINE SMART}
{$I SRL-OSR/SRL.Simba}

procedure declarePlayers();
var
HowManyPlayers : Integer;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

with Players[0] do
begin
Name := '';
Pass := '';
Pin := '';
Nick := '';
LampSkill := SKILL_HERBLORE;
Active := True;
end;
end;

begin
clearDebug();
declarePlayers();
setupSRL();
loginPlayer();
end.

For RS3 (SRL-6) I have no idea how you'd do a test script.


program scriptSkeleton;
{$define smart}
{$i srl-6/srl.simba}
{$i sps/lib/sps-rs3.simba}
{$define debug_on}

///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.
///////////////////////////////////
///// Start Setup ///////
///////////////////////////////////
///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.

const
(* player info *)
playerNames = ['']; //Put your player's name (or nickname, if you set one) here.
playerFile = 'default'; //Put your playerfile's name here. Default is 'default'.
desiredWorld = 0; //Enter your desired world number here.

(* globals *)


(* options *)


///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!
///////////////////////////////////
///// Stop Setup ///////
///////////////////////////////////
///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!

var
placeHolder:integer;

procedure writeDebug(text:string);
begin
{$IFDEF debug_on}
writeLn('[DEBUG] : ' + text);
{$ENDIF}
end;

procedure writeWarn(text:string);
begin
{$IFDEF debug_on}
writeln('');
writeLn('[WARNING] : ' + text);
writeln('');
{$ENDIF}
end;

procedure writeError(text:string);
begin
{$IFDEF debug_on}
writeln('');
writeLn('[ERROR] : ' + text);
writeln('');
{$ENDIF}
end;

procedure initScript();
var
i:integer;
begin
clearDebug();
addOnTerminate('scriptTerminate');
smartEnableDrawing := true;
smartShowConsole := false;
smartPlugins := ['d3d9.dll'];
writeDebug('Spawning SMART client...');
setupSrl();
disableSrlDebug := true;
players.setup(playerNames, playerFile);
currentPlayer := 0;
for i := 0 to high(players) do
begin
players[i].world := desiredWorld;
players[i].isActive := true;
writeDebug('Logging in...');
end;
begin
if (not players[currentPlayer].login()) then exit;
exitTreasure();
writeDebug('Setup complete - player is logged in.');
end;
end;

procedure initPlayer();
begin
writeDebug('Setting camera.');
minimap.clickCompass;
minimap.setAngle(MS_ANGLE_HIGH);

writeDebug('Setting run.');
if not (minimap.isRunEnabled()) then
minimap.toggleRun(true);

writeDebug('Setting gametab.');
if (not gameTabs.isTabActive(TAB_BACKPACK)) then
gameTabs.openTab(TAB_BACKPACK);
end;

procedure scriptTerminate();
begin
writeWarn('*** Terminating script ***');
writeDebug('Logging out');
if isLoggedIn() then
players[currentPlayer].logout();
writeDebug('Freeing BMPs');
writeDebug('Freeing DTMs');
writeWarn('*** Terminated script ***');
end;

begin
initScript();
initPlayer();
end.
That's my SRL-6 script skeleton.