bot_minplayers rotation.txt help

11 replies [Last post]
ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:

Hello all

I am trying to figure out some way to change bot_minplayers as clients join my server. I have bot_minplayers 5 and on arival of two clients I want to kick all bots and on departure of clients the bots enter back into the game. I have tried many ways such as : if ( xp_activeclients > 1 ) { bot_minplayers 0 }
else { bot_minplayers 5 }

or something like this if ( xp_activeclients > 1 ) { k allbots }

Can someone tell me if it is possible to do this. Im thinking its not cause I have not seen this done on any server.
If not I would like to see such feature in the future.

SHUDDER
shudder's picture
Offline
Joined: Feb 2010
Posts:
Re: bot_minplayers rotation.txt help

Rotation works when map is finished and only then you can apply the conditions based on these variables. It won't kick bots during game, but should work on next map. Also you have syntax error there - missed colon after var name when u set it's value:

if ( xp_activeclients > 1 )  { bot_minplayers: 0 }
else { bot_minplayers: 5 }

THOR*ELITE'Z*
Thor-NL's picture
Offline
Joined: Jan 2011
Posts:
NL Netherlands
Re: bot_minplayers rotation.txt help

Did you try that in a CronTab batch ?

Say with intervals of 1 minute you can check if conditions are met, not as people enter or leave. (I think..)

www.elitez.eu


The whole world is searching for Waldo...
In Soviet Russia, Waldo finds YOU !

ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help
THOR*ELITE'Z* wrote:

Did you try that in a CronTab batch ?

Say with intervals of 1 minute you can check if conditions are met, not as people enter or leave. (I think..)

This sounds like it could work. Not like I wanted but a really good idea. I will try and see what happens.
Thanks!

ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help

I added this to to crontab.txt to execute every minute.

if ( xp_activeClients >= 2 ) {
bot_minplayers: 1
}
else if ( xp_activeclients <= 1 ) { bot_minplayers: 7 }

the code does not work. I got some strange results while changing the code around.
With server running 7 bots, 2 clients join in and all bots are kicked but when the clients leave the server only one bot returns. I worded the code in many different ways with different result.
It is like the command bot_minplayers is can only be used once in the code.
If i do it this way:

if ( xp_activeClients >= 1 ) {
bot_minplayers: 7
}
else if ( xp_activeclients >= 2 ) { bot_minplayers: 1 }

The server starts , adds 7 bots and after one minute the crontab executes and all bots are kicked but immediately start to respawn. When clients join it makes no difference.
I am sure their is some kind of hack to get around my problem but my wee little brain cant figure it out so unless someone has some info on this, i give up.

FranK
frank's picture
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help
ditto*ELITE'Z* wrote:

else if ( xp_activeclients <= 1 ) { bot_minplayers: 7 }

should this line read

else ( xp_activeclients <= 1 ) { bot_minplayers: 7 } ?

remove the if because i think the code is asking for another argument.

"Beauty can cover a multitude of sins. But underneath, we all look exactly the same."

Frank Breitkopf :- no way out

ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help

yes Frank you are correct but I have tried many ways and none worked correctly. It made no difference else if or just else. I just gave up in conclusion that E+ scripting just will not allow my script to work the way I want. X amount of bots unless 2 or more players are active. That way 1 client can battle the bots and when the second client joins all bot are kicked. Everthing works fine except when clients leave only one bot enters. Bot_minplayers remain as 1.

FranK
frank's picture
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help

I think the if ~ else scenario is only checked upon rotation, which is why it is failing, maybe someone else from the e+ team could confirm this?

but, hmmm.. let me dwell on it, i like a challenge, if i come up with a solution i will let you know.

"Beauty can cover a multitude of sins. But underneath, we all look exactly the same."

Frank Breitkopf :- no way out

ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help

Thank you Frank.
I thought of the map rotaton solution but when the map rotates bot_minplayers still remains as 1. It is increadable at the many ways to try to accomplish this so I must have missed one. I have even put the script in a .cfg and told E+ to exec. it every minute and at map rotation. Good luck, im sure many server admins. would like to be able to do this.

ditto*ELITE'Z*
Offline
Joined: Jan 2011
Posts:
Re: bot_minplayers rotation.txt help

Since the latest E+ update I got this to work.
Just thought I would say so.

THOR*ELITE'Z*
Thor-NL's picture
Offline
Joined: Jan 2011
Posts:
NL Netherlands
Re: bot_minplayers rotation.txt help

Great job ditto !!

Would you be so kind to share the snippet of code that made it work?

And are you executing this from cron?

www.elitez.eu


The whole world is searching for Waldo...
In Soviet Russia, Waldo finds YOU !