HL2DM: Bots on and off

A place for requesting new Source.Python plugins to be made for your server.

Please request only one plugin per thread.
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

HL2DM: Bots on and off

Postby daren adler » Sat Apr 22, 2023 11:36 pm

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:
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM: Bots on and off

Postby cssbestrpg » Sun Apr 23, 2023 1:55 pm

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')
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Mon Apr 24, 2023 9:33 pm

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
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM: Bots on and off

Postby cssbestrpg » Tue Apr 25, 2023 4:16 pm

Weird, that code should execute the command turn on bots when map isn't gg one when new map starts.
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Tue Apr 25, 2023 7:26 pm

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.
User avatar
Articha
Member
Posts: 32
Joined: Tue Sep 21, 2021 12:13 pm
Location: Russia

Re: HL2DM: Bots on and off

Postby Articha » Wed Apr 26, 2023 5:32 pm

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
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Thu Apr 27, 2023 2:41 am

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.
cssbestrpg
Senior Member
Posts: 310
Joined: Sun May 17, 2020 7:56 am
Location: Finland
Contact:

Re: HL2DM: Bots on and off

Postby cssbestrpg » Thu Apr 27, 2023 12:25 pm

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')
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Tue May 02, 2023 8:42 pm

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.
User avatar
L'In20Cible
Project Leader
Posts: 1534
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: HL2DM: Bots on and off

Postby L'In20Cible » Fri May 12, 2023 4:29 pm

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.
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Fri May 12, 2023 10:20 pm

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:
User avatar
daren adler
Senior Member
Posts: 348
Joined: Sat May 18, 2019 7:42 pm

Re: HL2DM: Bots on and off

Postby daren adler » Sat May 13, 2023 5:26 am

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.

Return to “Plugin Requests”

Who is online

Users browsing this forum: No registered users and 1 guest