SRL Archive - Jr. Member General Help and Discussion

Help with SmartGrphics causing compile failure


loragnor

2013-08-02 17:27:17

Through a process of elimination, this is the bit that is causing the problem.

{$IFDEF SMART8}
{$include_once SRL/SRL/Misc/SmartGraphics.Simba} // fails here
{$ENDIF}

Smart8 is defined. I'm using Simba 1.0, Smart 8.2, SRL-5, and the PS interpreter. The only error message is "Compiling failed."

Sjoe

2013-08-02 18:03:55


{$IFDEF SMART}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}

loragnor

2013-08-02 18:14:47

From: Sjoe

{$IFDEF SMART}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}


Yeah, that's what it was originally. I used '$include_once' hoping it would solve the issue.

Sjoe

2013-08-02 18:21:54

From: loragnor
Yeah, that's what it was originally. I used '$include_once' hoping it would solve the issue.


that doesn't work?

whole script please ?

loragnor

2013-08-02 18:36:01

From: Sjoe
that doesn't work?

whole script please ?



program new;
{$DEFINE SMART8} //Comment this out if using a standard browser (also if you have compile issues)

{$include_once SRL/SRL.simba}
{$include_once SPS/sps.simba}
{$include_once SRL/SRL/misc/reports.simba}
{$include_once SRL/SRL/skill/fighting.simba}

{$include_once SRL/SRL/misc/MouseHandler.simba}
{$include_once SRL/SRL/misc/AntiBan.simba}
{$include_once SRL/SRL/misc/debug.simba}

{$IFDEF SMART8}
{$include_once SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}

const
DEBUG = True;

// Screen Areas
// Main Screen
// Minimap
// Ability Bar
// Chat box
// Skills box
// Magic Abilities
// Prayers
// Notes
// Inventory
// Backpack
// Worn Equipment

var
x,y,cnt: Integer;

{*******************************************************************************
Procedure DeclarePlayers(NumPlayers, CurPlayer: Integer);
Author: Loragnor
Last Edit: 1 August 2013
Use: DeclarePlayers(1, 0);
Description: This procedure interfaces with the players.simba file and declares
the number of players in the Players array as well as the current player index
to use.
*******************************************************************************}
Procedure DeclarePlayers(NumPlayers, CurPlayer: Integer);
begin
HowManyPlayers := NumPlayers;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := CurPlayer;
end;

{*******************************************************************************
Procedure DefineUserVars;
Author: Loragnor
Last Edit: 1 August 2013
Use: DefineUserVars;
Description: Use this procedure to define user variables.
*******************************************************************************}
Procedure DefineUserVars;
begin
// Do not touch this block please. It allows SRL_Warn to give debugging info.
begin
if DEBUG then WarnSensitivity := warn_Debug
else WarnSensitivity := warn_Notice;
end;

// Declare the current player(s)
// DeclarePlayers(NumberOfPlayersListed,CurrentPlayer)
DeclarePlayers(3,0);
{*****************************************************************************
// Player model
Players[x].Name := '';
Players[x].Pass := '';
Players[x].Pin := '';
Players[x].Member := True or False;
Players[x].WorldInfo := [True or False,#,True or False]; // [member_world,world_number,PK_world]
Players[x].Nick := ''; // 3 or 4 letters of screen name. Do not include the first
Players[x].Active := True or False; // Must be True if set as current player
*****************************************************************************}
{*** Players used with this script ***}
// Player 0
Players[0].Name := 'example@domain.com';
Players[0].Pass := 'password';
Players[0].Pin := '1234';
Players[0].Member := True;
Players[0].WorldInfo := [True,114,False];
Players[0].Nick := 'blah';
Players[0].Active := True;
end;

{*******************************************************************************
Procedure DefineScriptVars;
Author: Loragnor
Last Edit: 1 August 2013
Use: DefineScriptVars;
Description: This procedure defines variables used by this script.
*******************************************************************************}
Procedure DefineScriptVars;
begin
end;

{*******************************************************************************
Procedure MainLoop;
Author: Loragnor
Last Edit: 1 August 2013
Use: MainLoop;
Description: This procedure is the beating heart of ths script.
*******************************************************************************}
Function MainLoop(var cnt: Integer): Boolean;
var
x,y: Integer;
begin
Result := False;
GetClientDimensions(x,y);
cnt := CountColorTolerance(16711422,0,0,x-1,y-1,5);
if ((cnt > 1075) and (cnt < 1300)) then
Result := True;
end;

begin
ClearDebug;
DefineUserVars;
SetUpSRL;
// Do not touch this block please. It allows SRL_Warn to give debugging info.
begin
if DEBUG then WarnSensitivity := warn_Debug
else WarnSensitivity := warn_Notice;
end;
DefineScriptVars;

x:=0;
repeat
writeln(x);
inc(x);
until MainLoop(cnt);

writeln('color 16711422 occures '+tostr(cnt)+' times and the client is loaded');
end.

Just a testing script to pick out some stuff.

Edit: I notice that in the function list, SmartGraphics is listed under the included files, but none of the functions are listed. Likewise, if I type in the name of one of the functions from SmartGraphics in the search box, it is not found. However, loading SmartGraphics for editing, the functions show under the Script part of the function list.

Sjoe

2013-08-02 18:40:09

From: loragnor

program new;
{$DEFINE SMART8} //Comment this out if using a standard browser (also if you have compile issues)

{$include_once SRL/SRL.simba}
{$include_once SPS/sps.simba}
{$include_once SRL/SRL/misc/reports.simba}
{$include_once SRL/SRL/skill/fighting.simba}

{$include_once SRL/SRL/misc/MouseHandler.simba}
{$include_once SRL/SRL/misc/AntiBan.simba}
{$include_once SRL/SRL/misc/debug.simba}

{$IFDEF SMART8}
{$include_once SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}

const
DEBUG = True;

// Screen Areas
// Main Screen
// Minimap
// Ability Bar
// Chat box
// Skills box
// Magic Abilities
// Prayers
// Notes
// Inventory
// Backpack
// Worn Equipment

var
x,y,cnt: Integer;

{*******************************************************************************
Procedure DeclarePlayers(NumPlayers, CurPlayer: Integer);
Author: Loragnor
Last Edit: 1 August 2013
Use: DeclarePlayers(1, 0);
Description: This procedure interfaces with the players.simba file and declares
the number of players in the Players array as well as the current player index
to use.
*******************************************************************************}
Procedure DeclarePlayers(NumPlayers, CurPlayer: Integer);
begin
HowManyPlayers := NumPlayers;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := CurPlayer;
end;

{*******************************************************************************
Procedure DefineUserVars;
Author: Loragnor
Last Edit: 1 August 2013
Use: DefineUserVars;
Description: Use this procedure to define user variables.
*******************************************************************************}
Procedure DefineUserVars;
begin
// Do not touch this block please. It allows SRL_Warn to give debugging info.
begin
if DEBUG then WarnSensitivity := warn_Debug
else WarnSensitivity := warn_Notice;
end;

// Declare the current player(s)
// DeclarePlayers(NumberOfPlayersListed,CurrentPlayer)
DeclarePlayers(3,0);
{*****************************************************************************
// Player model
Players[x].Name := '';
Players[x].Pass := '';
Players[x].Pin := '';
Players[x].Member := True or False;
Players[x].WorldInfo := [True or False,#,True or False]; // [member_world,world_number,PK_world]
Players[x].Nick := ''; // 3 or 4 letters of screen name. Do not include the first
Players[x].Active := True or False; // Must be True if set as current player
*****************************************************************************}
{*** Players used with this script ***}
// Player 0
Players[0].Name := 'example@domain.com';
Players[0].Pass := 'password';
Players[0].Pin := '1234';
Players[0].Member := True;
Players[0].WorldInfo := [True,114,False];
Players[0].Nick := 'blah';
Players[0].Active := True;
end;

{*******************************************************************************
Procedure DefineScriptVars;
Author: Loragnor
Last Edit: 1 August 2013
Use: DefineScriptVars;
Description: This procedure defines variables used by this script.
*******************************************************************************}
Procedure DefineScriptVars;
begin
end;

{*******************************************************************************
Procedure MainLoop;
Author: Loragnor
Last Edit: 1 August 2013
Use: MainLoop;
Description: This procedure is the beating heart of ths script.
*******************************************************************************}
Function MainLoop(var cnt: Integer): Boolean;
var
x,y: Integer;
begin
Result := False;
GetClientDimensions(x,y);
cnt := CountColorTolerance(16711422,0,0,x-1,y-1,5);
if ((cnt > 1075) and (cnt < 1300)) then
Result := True;
end;

begin
ClearDebug;
DefineUserVars;
SetUpSRL;
// Do not touch this block please. It allows SRL_Warn to give debugging info.
begin
if DEBUG then WarnSensitivity := warn_Debug
else WarnSensitivity := warn_Notice;
end;
DefineScriptVars;

x:=0;
repeat
writeln(x);
inc(x);
until MainLoop(cnt);

writeln('color 16711422 occures '+tostr(cnt)+' times and the client is loaded');
end.

Just a testing script to pick out some stuff.


Hmm it compiles fine for me :s

loragnor

2013-08-02 18:42:55

From: Sjoe
Hmm it compiles fine for me :s


Which version of simba are you using? Also, see my edit above.

Sjoe

2013-08-02 19:01:32

From: loragnor
Which version of simba are you using? Also, see my edit above.


Yeah I'm using the latest smart, don't really know why it occurs to you. This is peculiar.

loragnor

2013-08-02 19:08:43

From: Sjoe
Yeah I'm using the latest smart, don't really know why it occurs to you. This is peculiar.


K. Well, I will try a reinstall and see what happens from there. Thanks for the help.

Edit:
As a closure to this issue, I forced a reinstall of simba, and the issue was solved. It is very possible that I missed doing this on the initial install. Anyway, it is fixed and done.