Add bots after player joins
I have "set bot_minplayers "4" in server.cfg. The bots play all the time even when there's no one on the server. Is there a way to have bots join game after a player connects?
You can use the crontab to simulate this.
crontab.txt:
if ( activeClients() ) { $bot_minplayers = 4; } else { $bot_minplayers = 0; exec("kick allbots"); }
Note: The crontab gets executed once per minute.
You can use the crontab to simulate this.
crontab.txt:
if ( activeClients() ) { $bot_minplayers = 4; } else { $bot_minplayers = 0; exec("kick allbots"); }Note: The crontab gets executed once per minute.
is it possible to set own execution time for cron, like some cmd: xp_cronTime "10"
Where the value is interpreted by the seconds, this could let execute it much faster
command bot_minplayers works with one minute dalay to add next bots i mean
sorry for my naive reply here but does it not function at all when the crontab runs? - is that the issue
you're limited by the intervals at which the crontab can run, but when it does run every minute, its not adding bots or its not running that check every 10 seconds.
it looks as if you're trying to find a workaround for seconds rather than minutes- if what cml suggested was an option, then you could do this by specifying the crontab interval rather than utilising crontab to set the interval at which to run the check
i see crontab can be used to run things every few miuntes, but i dont see an option for seconds or at least i cannot decipher this from the documentation:
# Format: Minute Hour Day Month DayOfWeek Expression
#
# values can be
# - an asterisk: *
# - a list: 1,2,3,4
# - a range: 1-4
# - a step: */2
#
# and all sorts of combinations, which internally will be reduced
# from 0,1,2-4,5,6,7/3
# to 0,1,2,3,4,5,6,7/3
# and finally 0,3,6
#
# Month and DayOfWeek can also be abbreviations of their name
# e.g. Jan, Feb, Mar ... or Mon, Tue, Wed ...
and also:
// multi-line comments are not available to prevent unexpected
// behavior with asterisk steps e.g. */2
so if you're setting the script to run on a time interval, whether or not seconds is an option, even if u tried with minutes, surely it would need to be a single line?
and i would have thought the timing would be set at the beggining rather than after the check for active clients
*/10 * * * * * if ( activeClients() ) { $bot_minplayers = 4;} else { $bot_minplayers = 0; exec("kick allbots") ;}
this would need to function from a single line would it not?
congratulations , this what i say about minute interval , i know it
for others
when bot_minplayers command are executed , a one minute delay must wait to add first one bot
if command are executed every less time for example in 10 seconds interval
every new started command bot_minplayers restart delay 1 minute must wait to 0 seconds
start from begin and bot not come to game
my result how to do bot_minplayers to be executable in sooner intervals and realy add bots
is touch code of bot_minplayers command what is C code in quake 3 arena inside
copy that C function extract from source codes vivat radiant and sources
then make different one with choosable delay
this will be add to game as dll or so library similar to programming other things
delay 1 minute is old protect against spam with add bot manipulators
It works fine running every minute, but does not work
at all tring to use any variation of seconds.
I'm not sure how to implement
by specifying the crontab interval rather than utilising
crontab to set the interval at which to run the check
*/10
means once per 10 minutes.
*
means every minute
there's no way to set schedule to anything more frequent than once per minute.
Thank you. I'll give it a try. Do I change the setting in server.cfg?