SRL Archive - OSR Help

SMART + Reading textfile


J J

2012-09-30 07:13:07

Hello,

I'm looking to compile a list of accounts by reading a text file. I've managed to get this working but now that I'm trying to make it work with SMART it doesn't work.

The top
program Rotate;
{$DEFINE SMART}
{$i SRL/srl.simba}

Mainloop
begin
SetupSRL;
AccountDetails := GetAccounts('C:/Simba/accounts.txt');
DeclarePlayers;
LoginPlayerToLob;
OpenWorldScreen;
SelectWorld(53);
LoginPlayer;
Wait(3000 + Random(3000));
MarkTime(Timer);

DeclarePlayers
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := AccountDetails[n][0];
Players[0].Pass := AccountDetails[n][1];
Players[0].Active := True;
Players[0].Pin := '';
Players[0].Member := true;
end;

I guess SetupSRL doesn't get called before the account is logged in or something? With SMART:
Total accs: 0
Error: Out Of Range at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]

Commenting DEFINE SMART out
Total accs: 19
Successfully executed.

Any idea how I can fix this? I guess it's something simple but yeah.

Thanks in advance.

riwu

2012-09-30 07:53:28

SetupSRL must be called before your SMART will start/get paired so that's probably not the problem. What's the include file that popup? (which shows Error: Out Of Range at line 64). And post the GetAccounts function if possible.

J J

2012-09-30 08:14:46

From: riwu
SetupSRL must be called before your SMART will start/get paired so that's probably not the problem. What's the include file that popup? (which shows Error: Out Of Range at line 64). And post the GetAccounts function if possible.

Error: Out Of Range at line 64
The following DTMs were not freed: [SRL - Lamp bitmap, 1]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Flag bitmap, SRL - NavBar Bitmap]

Line 64: Accounts[0] := StringArray[0];

The main problem is that it doesn't read the file properly. I read the whole file as a single String and split it on each enter (VK_RETURN). But when I print out all the stuff when using SMART there is no value 13 at all which is VK_RETURN. But when I'm not using SMART there is no error.

So this is a part
for i:=1 to Length(s) do
begin
//writeln(s[i]); // THE CHARACTERS
b := GetKeyCode(s[i]);
//writeln(b);
if (b = VK_RETURN) then
begin
Because there is no VK_RETURN anywhere when using it with SMART the array stays empty. And then you get an out of range error because it's empty.

Kasi

2012-09-30 12:02:05

PM me the script/ upload the entire script?, also is VK_Return the same as new line?

Runaway

2012-09-30 12:24:13

Perhaps you could try using an ini instead? It's ideal for things like player data :)