Page 1 of 1

HL2DM: Bots on and off

Posted: Sat Apr 22, 2023 11:36 pm
by daren adler
Hello script writers :smile: . I am using hrcbot for my bots on my server, i am using the map-config to be able to change type of game while on a gg map and change back to normal when on a non gungame (gg) map. the only trouble i have is sometimes when you go to a non gg map after being on a gungame map, it still keeps the bots off untill next map or rtv or admin change map, i would like a plugin to fix that please. :smile: Thank you and have a great weekend. :cool:

Re: HL2DM: Bots on and off

Posted: Sun Apr 23, 2023 1:55 pm
by cssbestrpg
Hi try this code(Untested)

Syntax: Select all

from listeners import OnLevelInit
from engines.server import queue_command_string

@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')

Re: HL2DM: Bots on and off

Posted: Mon Apr 24, 2023 9:33 pm
by daren adler
cssbestrpg wrote:Hi try this code(Untested)

Syntax: Select all

from listeners import OnLevelInit
from engines.server import queue_command_string

@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
queue_command_string('hrcbot_enabled 1')



Thank you for trying but it did not work on me, left no errors in sp logfile either. I did have a script writer make a script that was for the hrcbots for weapons https://forums.sourcepython.com/viewtopic.php?f=37&t=2521 and to turn the hrcbots on and off are hrcbot_enabled 1 < -on, and hrcbot_enabled 0 <-off

Re: HL2DM: Bots on and off

Posted: Tue Apr 25, 2023 4:16 pm
by cssbestrpg
Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.

Re: HL2DM: Bots on and off

Posted: Tue Apr 25, 2023 7:26 pm
by daren adler
cssbestrpg wrote:Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.


Ok, thanks for trying, i looked again after i updated my source-python, and it still will not work, i even added dm insteed of gg and it still let the bots on. i just need a plugin i guess that you could turn the bots on and off in game, Here are some of the bots setting if that will help

Code: Select all

//Hurricane Bot settings
hrcbot_enabled 1
hrcbot_minplayers 0
hrcbot_maxplayers 5
hrcbot_handicap 65
hrcbot_motd 0
hrcbot_dialogmsg 1
hrcbot_freezeifnoplayers 0
hrcbot_spawnprotectionseconds 2
hrcbot_spawnprotectedhealth 125
hrcbot_player_spawnweapon smg1
hrcbot_clan ""

Hope that will help. if you need anything else please ask.

Re: HL2DM: Bots on and off

Posted: Wed Apr 26, 2023 5:32 pm
by Articha
Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs

Re: HL2DM: Bots on and off

Posted: Thu Apr 27, 2023 2:41 am
by daren adler
Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.

Re: HL2DM: Bots on and off

Posted: Thu Apr 27, 2023 12:25 pm
by cssbestrpg
daren adler wrote:
Articha wrote:Well, if nothing works, try delaying queue_command_string command. May be plugin switches bots after our command command. Also, debug this switch and look, if it at least runs
Ok can you show me what to do on here please, i am just trying to have my hrcbots (hurricane bots ) able to turn on and off in game.


Syntax: Select all

from listeners.tick import Delay
from listeners import OnLevelInit
from engines.server import queue_command_string

@OnLevelInit
def map_start(current_map):
if not current_map.startswith('gg'):
Delay(0, queue_command_string, ('hrcbot_enabled 1',))
print(f'Executed bots on for {current_map} map')

Re: HL2DM: Bots on and off

Posted: Tue May 02, 2023 8:42 pm
by daren adler
I tryed it and it will not work, i updated sp, i even changed the "gg" to "asc" (other maps i have asclan maps), and did not work, gives no errors on log. I am thinking its the hrcbots. Thank you for all your help/try.

Re: HL2DM: Bots on and off

Posted: Fri May 12, 2023 4:29 pm
by L'In20Cible
My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.

Re: HL2DM: Bots on and off

Posted: Fri May 12, 2023 10:20 pm
by daren adler
L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.


ok, will try. ty :smile:

Re: HL2DM: Bots on and off

Posted: Sat May 13, 2023 5:26 am
by daren adler
daren adler wrote:
L'In20Cible wrote:My first guess would be that your bots plugin is loaded prior SP and its callbacks do their things before the variable is enabled. Try to load SP first.


ok, will try. ty :smile:
Come to think about it, i do not even have my bots in my autoexec file, but i will try with it on there (remove from server.cfg) and add them to my autoexec file at the end.