SRL Archive - SRL Bugs

[SRL][Bank] - OpenBankNPCEx('grey'): Out of Range error.. cause the script to termin


Zorgatone

2013-02-05 00:31:23

H there,

I have this issue..

http://villavu.com/forum/project.php?issueid=38

I think it's an easy fix, can you take a look on it, please? I need to use this function.
Thanks you very much.

Zorgatone

Flight

2013-02-05 00:34:33

It is an easy fix but the problem lies with your scripts. You need to use 'DeclarePlayers' mate. Try this instead:


program test;
{$DEFINE SMART8}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Member := True;
Active := True;
end;
end;

begin
SetupSrl;
DeclarePlayers;
OpenBankNPCEx('grey');
end.

Justin

2013-02-05 00:34:39

I know @Ollybest updated this recently, maybe he might be able to find a solution and push it.

Olly

2013-02-05 00:45:44

https://github.com/Ollybest/SRL-5/commit/b2a4e4c4b9fca71a6ea0954d9941483237ae9a2c

As Flight said its properly best to declare players :p. Also im not sure if (or even how) the function will run at the ge lol, i didn't even know the bankers were grey there.

Zorgatone

2013-02-05 08:06:31

From: Flight
It is an easy fix but the problem lies with your scripts. You need to use 'DeclarePlayers' mate. Try this instead:


program test;
{$DEFINE SMART8}
{$i srl/srl.simba}

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Member := True;
Active := True;
end;
end;

begin
SetupSrl;
DeclarePlayers;
OpenBankNPCEx('grey');
end.


LOL mate, I was already logged in with SMART.. That's not the problem xD.

From: Ollybest
https://github.com/Ollybest/SRL-5/commit/b2a4e4c4b9fca71a6ea0954d9941483237ae9a2c

As Flight said its properly best to declare players :p. Also im not sure if (or even how) the function will run at the ge lol, i didn't even know the bankers were grey there.


Yes, they are gray.. Anyway I don't think the problem is to declare the players.. Because I was already logged in. :P


E1: Oh I see the code that you linked.. That might have been the problem.. Let me check.

E2: Lol, it works now.. I Only had to update SRL again.. I've updated recently but it wasn't the last revision. :P

Flight

2013-02-05 10:48:39

From: Zorgatone
LOL mate, I was already logged in with SMART.. That's not the problem xD.


Well you're half right about that. The recent fix was adding this line:

if not (AllPlayersInactive) then

Which is, basically, the current player's PIN # is entered only if the current player even exists, thus through DeclarePlayers. So actually had you used DeclarePlayers as I told you before, your problem would be fixed.