SRL Archive - General Botting Help

Player inactive?


Nufineek

2015-03-09 11:56:14

Everytime when my script reloads the client and tries to log back in but fills the username and pass in one line it gets the player inactive and doesnt try again. Sometimes it fills both the username and pass in the right lines but I get the inactive error as well. How would prevent the player becoming inactive? I want my script to run until a termination comes from my code and this blocks me to do so.
—— FATAL ERROR: No active players, no use in reloading the client!

3Garrett3

2015-03-09 12:01:23

From: Nufineek
Everytime when my script reloads the client and tries to log back in but fills the username and pass in one line it gets the player inactive and doesnt try again. Sometimes it fills both the username and pass in the right lines but I get the inactive error as well. How would prevent the player becoming inactive? I want my script to run until a termination comes from my code and this blocks me to do so.
—— FATAL ERROR: No active players, no use in reloading the client!


Can you post your declarePlayers procedure and your main loop so we know what went wrong? I assume you're missing a part of declarePlayers or not calling it in your loop.

Nufineek

2015-03-09 13:06:35

From: 3Garrett3
Can you post your declarePlayers procedure and your main loop so we know what went wrong? I assume you're missing a part of declarePlayers or not calling it in your loop.


my declarePlayers
procedure declarePlayers();
var
i, j: integer;
begin
players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
currentPlayer := 0; // player to use first

for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]); //minutes until break
integers[1] := strToInt(playerForm.players[i].settings[1]); //minutes to break
ENABLE_BREAKS := strToBool(playerForm.players[i].settings[2]);
DIRECT_X := strToBool(playerForm.players[i].settings[3]);
WHAT_TO_DO := playerForm.players[i].settings[4];
WHAT_TO_DO_2ND := playerForm.players[i].settings[5];
for j := 0 to high(playerForm.comboBoxItems[2]) do
if (playerForm.players[i].settings[6] = playerForm.comboBoxItems[2][j]) then
integers[2] := j; //bankinglocation
randomType := strToInt(playerForm.players[i].settings[7]);
end;
end;

my mainLoop
procedure MainLoop;
var
t: TTimemarker;
Time: integer;
begin
if not isLoggedIn then
begin
wait(5000);
writeln('Attempting to log back in');
disableSRLDebug := false;
t.start;
time := gaussRangeInt(460000, 650000);
repeat
if (not players[currentPlayer].login) then
sixHourFix;
if (t.getTime) > time then
begin
writeln('could not log back in. Terminating');
terminateScript;
end;
until isLoggedIn;
disableSRLDebug := true;
wait(gaussRangeInt(3000, 6000));
mainScreen.setAngle(MS_ANGLE_HIGH);
inc(logBackIn);
end;
if (not banking) then
begin
if (isLoggedIn) then
begin
writeln('Could not bank in a given time! Terminating!');
players[currentPlayer].exitToLobby();
terminateScript;
end;
end else
begin
lookingAtWeb;
withdrawItems;
end;
findNormalRandoms;
makeItems;
progressReport;
if ENABLE_BREAKS then
breakHandler(players[currentPlayer].integers[0], players[currentPlayer].integers[1], bir, bfr);
end;

begin
Setup;
while (players.getActive() > 0) do
mainloop();
end.

3Garrett3

2015-03-09 13:41:11

From: Nufineek
my declarePlayers
procedure declarePlayers();
var
i, j: integer;
begin
players.setup(playerForm.playerNames, playerForm.playerFile); // load the SPF players from the SRL Player Manager
currentPlayer := 0; // player to use first

for i := 0 to high(players) do
with players[i] do
begin
integers[0] := strToInt(playerForm.players[i].settings[0]); //minutes until break
integers[1] := strToInt(playerForm.players[i].settings[1]); //minutes to break
ENABLE_BREAKS := strToBool(playerForm.players[i].settings[2]);
DIRECT_X := strToBool(playerForm.players[i].settings[3]);
WHAT_TO_DO := playerForm.players[i].settings[4];
WHAT_TO_DO_2ND := playerForm.players[i].settings[5];
for j := 0 to high(playerForm.comboBoxItems[2]) do
if (playerForm.players[i].settings[6] = playerForm.comboBoxItems[2][j]) then
integers[2] := j; //bankinglocation
randomType := strToInt(playerForm.players[i].settings[7]);
end;
end;

my mainLoop
procedure MainLoop;
var
t: TTimemarker;
Time: integer;
begin
if not isLoggedIn then
begin
wait(5000);
writeln('Attempting to log back in');
disableSRLDebug := false;
t.start;
time := gaussRangeInt(460000, 650000);
repeat
if (not players[currentPlayer].login) then
sixHourFix;
if (t.getTime) > time then
begin
writeln('could not log back in. Terminating');
terminateScript;
end;
until isLoggedIn;
disableSRLDebug := true;
wait(gaussRangeInt(3000, 6000));
mainScreen.setAngle(MS_ANGLE_HIGH);
inc(logBackIn);
end;
if (not banking) then
begin
if (isLoggedIn) then
begin
writeln('Could not bank in a given time! Terminating!');
players[currentPlayer].exitToLobby();
terminateScript;
end;
end else
begin
lookingAtWeb;
withdrawItems;
end;
findNormalRandoms;
makeItems;
progressReport;
if ENABLE_BREAKS then
breakHandler(players[currentPlayer].integers[0], players[currentPlayer].integers[1], bir, bfr);
end;

begin
Setup;
while (players.getActive() > 0) do
mainloop();
end.


Looks like I need the Setup function too. DeclarePlayers looks fine although you're using the old version of setup. It can be "players.setup(playerForm.players);" now.

I suspect that if the break is happening immediately then there's something not being declared right, like it isn't being declared active to start or you're not calling declarePlayers in the best spot or something. If it happens during runtime it's likely that one of your functions is making the player inactive.

So post Setup and I'll browse through to see.

Nufineek

2015-03-09 14:46:32

From: 3Garrett3
Looks like I need the Setup function too. DeclarePlayers looks fine although you're using the old version of setup. It can be "players.setup(playerForm.players);" now.

I suspect that if the break is happening immediately then there's something not being declared right, like it isn't being declared active to start or you're not calling declarePlayers in the best spot or something. If it happens during runtime it's likely that one of your functions is making the player inactive.

So post Setup and I'll browse through to see.


Thanks! Alright here's my setup

Procedure Setup
var
bmp, time: integer;
t: TTimeMarker;
begin
clearDebug();

initPlayerForm();
runPlayerForm();

if (not playerForm.isScriptReady) then
terminatescript;

declarePlayers();
smartEnableDrawing := true;
SRL_Events[EVENT_ANTIBAN] := @antiban;
setupSRL();
if DIRECT_X then
smartPlugins := ['d3d9.dll'];

if not isLoggedIn() then
begin
players[currentPlayer].loginToLobby();
t.start;
time := 50000;
repeat
if players[currentPlayer].loginToLobby() then
break;
wait(5000);
writeln('Waiting for lobby');
until false;
if lobby.quickSelectWorld(96) then
begin
t.start;
time := 50000;
repeat
if isLoggedIn then
begin
conversationBox.continue(true, true);
terminateScript;
end;
wait(4000);
writeln('waiting to login');
until false;
end else
terminateScript;
end;

minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
tabBackpack.Open;
findNormalrandoms;

bir := 30;
bfr := 7;

W := (players[currentPlayer].integers[0] * 60000);
X := (players[currentPlayer].integers[1] * 60000);
Y := randomRange(-BIR * 60000, BIR * 60000);
Z := randomRange(-BFR * 60000, BFR * 60000);

disableSRLDebug := true;
bmp := bitmapFromClient(0, 0, getClientBounds().x2 -1, getClientBounds().y2 -1);
clickedPot := DTMFromString('mlwAAAHicY2dgYJjKxMDQD8S9QNwNxDOAeC4QzwZidiDmB2IJIFYEYlUglgZiPiD+//8/TowPMOLBUAAA1LIZvw==');
clickedHerb := DTMFromString('mlwAAAHicY2dgYDBjYmDQB2J1ILYEYj0gdgJiZyDezsjAsAuIDwHxeSA+DcQngHg3EP///x8nxgcY8WAoAABsWBvX');
freeBitmap(bmp);
addOnTerminate('__freeMinimapMask');
addOnTerminate('freeDTMz');
end;

3Garrett3

2015-03-09 14:57:00

From: Nufineek
Thanks! Alright here's my setup

Procedure Setup
var
bmp, time: integer;
t: TTimeMarker;
begin
clearDebug();

initPlayerForm();
runPlayerForm();

if (not playerForm.isScriptReady) then
terminatescript;

declarePlayers();
smartEnableDrawing := true;
SRL_Events[EVENT_ANTIBAN] := @antiban;
setupSRL();
if DIRECT_X then
smartPlugins := ['d3d9.dll'];

if not isLoggedIn() then
begin
players[currentPlayer].loginToLobby();
t.start;
time := 50000;
repeat
if players[currentPlayer].loginToLobby() then
break;
wait(5000);
writeln('Waiting for lobby');
until false;
if lobby.quickSelectWorld(96) then
begin
t.start;
time := 50000;
repeat
if isLoggedIn then
begin
conversationBox.continue(true, true);
terminateScript;
end;
wait(4000);
writeln('waiting to login');
until false;
end else
terminateScript;
end;

minimap.clickCompass();
mainScreen.setAngle(MS_ANGLE_HIGH);
tabBackpack.Open;
findNormalrandoms;

bir := 30;
bfr := 7;

W := (players[currentPlayer].integers[0] * 60000);
X := (players[currentPlayer].integers[1] * 60000);
Y := randomRange(-BIR * 60000, BIR * 60000);
Z := randomRange(-BFR * 60000, BFR * 60000);

disableSRLDebug := true;
bmp := bitmapFromClient(0, 0, getClientBounds().x2 -1, getClientBounds().y2 -1);
clickedPot := DTMFromString('mlwAAAHicY2dgYJjKxMDQD8S9QNwNxDOAeC4QzwZidiDmB2IJIFYEYlUglgZiPiD+//8/TowPMOLBUAAA1LIZvw==');
clickedHerb := DTMFromString('mlwAAAHicY2dgYDBjYmDQB2J1ILYEYj0gdgJiZyDezsjAsAuIDwHxeSA+DcQngHg3EP///x8nxgcY8WAoAABsWBvX');
freeBitmap(bmp);
addOnTerminate('__freeMinimapMask');
addOnTerminate('freeDTMz');
end;


Hmm I'm not seeing anything out of the ordinary. DeclarePlayers is before SetupSRL() like I do in my scripts, and the form is before both of those like it should be. Is this "player inactive" error happening at the very start of the script? If so, then I'm not sure exactly what is causing it.

If it's happening during runtime, it could be a couple things. It could be the script is setting the player to inactive due to a bug that happened and then it can't log in because there's no active players. It could also be that the logging in portion is messing up, you mentioned putting user and pass on the same line. That would set your player to inactive, because the login couldn't work. If you have a laggy computer, it's possible that it's causing either of these bugs.

Is this your script and/or how old is it? Just off-hand, I see a lot of functions which aren't even required, like findNormalRandoms. I know that SRL automatically picks worlds now too if you have Players.world set in the declarePlayers portion. It seems like a lot of old practices.

If this is a currently supported script I'd suggest posting in the relevant thread and asking for help and the script owner might have more idea of what's happening in the script. If it's your script I'd suggest looking through to make sure you aren't getting set inactive for whatever reason during runtime.

The Mayor

2015-03-09 15:11:05

It would have nothing to do with his declarePlayers or setup :p Sounds like you failed to login after restart so it set your player inactive. The SRL-6 login methods are really messy so people are reluctant to go fix them :(

Nufineek

2015-03-09 15:21:35

From: 3Garrett3
Hmm I'm not seeing anything out of the ordinary. DeclarePlayers is before SetupSRL() like I do in my scripts, and the form is before both of those like it should be. Is this "player inactive" error happening at the very start of the script? If so, then I'm not sure exactly what is causing it.

If it's happening during runtime, it could be a couple things. It could be the script is setting the player to inactive due to a bug that happened and then it can't log in because there's no active players. It could also be that the logging in portion is messing up, you mentioned putting user and pass on the same line. That would set your player to inactive, because the login couldn't work. If you have a laggy computer, it's possible that it's causing either of these bugs.

Is this your script and/or how old is it? Just off-hand, I see a lot of functions which aren't even required, like findNormalRandoms. I know that SRL automatically picks worlds now too if you have Players.world set in the declarePlayers portion. It seems like a lot of old practices.

If this is a currently supported script I'd suggest posting in the relevant thread and asking for help and the script owner might have more idea of what's happening in the script. If it's your script I'd suggest looking through to make sure you aren't getting set inactive for whatever reason during runtime.


It only happens when trying to log back in - when the login function puts the name and pass on the same line….but sometimes it fills login just fine (each in one line) but doesn't log in and I get the error message I mentioned in the 1st post.

It's my script. And I don't think I have anything in my script that could set the player inactive. Does player.login set the player inactive when it fails for some reason?

3Garrett3

2015-03-09 15:26:58

From: Nufineek
Does player.login set the player inactive when it fails for some reason?


Yes it does. I've noticed it happen to me a few times. I've never had it type the user/pass into the same line though, so I would probably do a google search "site:villavu.com PROBLEMS" to see if it happened to anyone else and what they did to fix it. If nobody else notices it, you can submit a bug report and the devs will take a look when they can.

theholyone

2015-03-10 11:42:57

My solution to this fix is go into simba/includes/srl-6/lib/core/players

around line 1200

replace the enter user/pass with this

print('Entering username...');
wait(8000 + random(1000));

__enterLoginInfo(_boxUsername, self.loginName, true, true);

wait(8000 + random(1000));

print('Entering password...');

wait(8000 + random(1000));

__enterLoginInfo(_boxPassword, self.password, false, true);
end else begin
print('Entering info. using a secure method...');
__secureEnterInfo(self.loginName, self.password);
end;

do note that the login process will take around a minute and a half(to get logged into a world from my experience)… but it's better than crashing right? :)

use this for my really slow computer

you need to change it every srl update though

KeepBotting

2015-03-10 17:37:54

From: theholyone
My solution to this fix is go into simba/includes/srl-6/lib/core/players

around line 1200

replace the enter user/pass with this

print('Entering username...');
wait(8000 + random(1000));

__enterLoginInfo(_boxUsername, self.loginName, true, true);

wait(8000 + random(1000));

print('Entering password...');

wait(8000 + random(1000));

__enterLoginInfo(_boxPassword, self.password, false, true);
end else begin
print('Entering info. using a secure method...');
__secureEnterInfo(self.loginName, self.password);
end;

do note that the login process will take around a minute and a half(to get logged into a world from my experience)… but it's better than crashing right? :)

use this for my really slow computer

you need to change it every srl update though


This is what I have done for a long time - there were updates to SRL-6 a while ago that improved login routines somewhat, but this is still needed for a flawless experience.

theholyone

2015-03-10 18:29:54

From: KeepBotting
This is what I have done for a long time - there were updates to SRL-6 a while ago that improved login routines somewhat, but this is still needed for a flawless experience.


yeah, I think there was an update when i first asked a similar question, but the default was only for 250 + 200 random milliseconds, which doesn't really work for my super slow AMD tower.

what i've done to fix the problem 99% was to add the additional


wait(8000 + random(2000));
mouse(431,340,mouse_move);
wait(randomrange(100,500));
fastclick(mouse_left);


which would physically click the password box in case you lagged out and missed the enter key after typing in username