Raised This Month: $ Target: $400
 0% 

Automatic Bot Names


Post New Thread Reply   
 
Thread Tools Display Modes
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-01-2010 , 16:03   Re: Automatic Bot Names
Reply With Quote #41

Quote:
To be clear, it's using names from "botprofile.db" and not "botnames.txt" (or the database)? Also, what game are you running?
I'm running Counter-Strike: Source When I set DB connection, the names are simply being ignored and I see the default names from botprofile.db file in cstrike directory.
Quote:
Getting the names from the database each time a bot appears rather than storing them in memory would be a much more efficient option, but unfortunately it would require a little restructuring of the code.
Don't. Just sort by activity field decreasing and take only first X names or less when not enough. I would suggest to add a cvar on how many name to add.
Quote:
Off the top of my head, have you tried using just botnames.txt and not the database at all?
I tried the version without DB and it worked. But I could give a go with this one to.
FirEXE is offline
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-01-2010 , 16:15   Re: Automatic Bot Names
Reply With Quote #42

Setting sm_botnames_db_name "" did make reading and applying names from botnames.txt config as supposed to.
FirEXE is offline
agrif
Junior Member
Join Date: Jan 2010
Old 10-01-2010 , 19:14   Re: Automatic Bot Names
Reply With Quote #43

Well, one mysql install and some harrowing 32-bit compatibility library issues later, and I realized I should have just looked at the list of names.

As part of the update for TF2 auto-fill bots, the plugin will attempt to rename bots twice: once on creation, and once 10 seconds after joining a team. To prevent a double-rename, the code checks to see if the bot already has a name from the list, and skips it if it does. Unfortunately, this means it won't rename a bot if the name is already in the database.

I'm betting this is your problem. It's certainly what I'm getting over here, with your table.

A "quick" fix would be to remove all the bot names from your table, but I'm working on a code-based fix that should be ready sooner than if you manually removed those entries. It should be ready soon.
agrif is offline
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-01-2010 , 19:25   Re: Automatic Bot Names
Reply With Quote #44

I have custom made botprofile.db file with names from the very same stats.
I'll probably wait for the fix then, thanks.
FirEXE is offline
agrif
Junior Member
Join Date: Jan 2010
Old 10-01-2010 , 22:00   Re: Automatic Bot Names
Reply With Quote #45

Automatic Bot Names v1.2.1

I've fixed the bug we discussed, FirEXE, and added in extra options for getting names out of a database. I've also squashed a bug I just discovered where the plugin would load names before loading the configuration, leading to it always using botnames.txt no matter what. The plugin is attatched.

Since maintaining documentation updates for each release is starting to be a pain, I'll just say the full docs may always be found at this site.

As a quick guide, though, here's an example of the new options (particularly relevant to you, FirEXE):

Code:
sm_botnames_db_name "some_databases.cfg_name"
sm_botnames_db_table "hlstats_players"
sm_botnames_db_column "lastName"

sm_botnames_db_order_by "activity"
sm_botnames_db_descending "1"
sm_botnames_db_limit "100"

sm_botnames_db_use_utf8 "1"
Of course, I'm still getting default bot names with that database table -- but that's just because those names are in that table, with a high activity.

If you have any further issues, do not hesitate to tell me.
Attached Files
File Type: sp Get Plugin or Get Source (botnames.sp - 940 views - 15.8 KB)
agrif is offline
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-02-2010 , 08:28   Re: Automatic Bot Names
Reply With Quote #46

Thanks, already checking it out.

Edit:
It's perfect!

Now I have come with some more ideas on how to make the plugin even better.
1) Check if anybody connected on the server is already having the name.
2) Check on client join if his name is the same as plugin has chosen and if it is silently rename bot to another name.
3) And well, I didn't see anybody did it, but setting random avatar icons in scoreboard would even make me confused while detecting bots.

Last edited by FirEXE; 10-02-2010 at 08:40.
FirEXE is offline
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-02-2010 , 08:52   Re: Automatic Bot Names
Reply With Quote #47

Hmmm, I see what you meant, bots are logged in database. That’s bad. But this could be easily overcome, since bot have fields in the same table set to blank (aka ""):
lastAddress
city
state
country
flag

For now I hardcoded the query to
Format(dbquery, sizeof(dbquery), "SELECT %s FROM %s WHERE `lastAddress` != '' %s%s", dbcolumn, dbtable, orderpart, limitpart);
and it helped.

Last edited by FirEXE; 10-02-2010 at 09:28.
FirEXE is offline
FirEXE
Member
Join Date: Jun 2010
Location: Lithuania
Old 10-08-2010 , 10:35   Re: Automatic Bot Names
Reply With Quote #48

I've added player name check thing.
Plugin checks (using RegExp) if player has (1) sign in front of his nick on connection. If he does, plugin removes all “(1)” signs and checks if there are any bots that contain the resulting names. If the plugin finds such a BOT it will choose a new name for him.
When adding bots, plugins checks for there to be no players currently connected using the same name.
The first check will not work if player using “(1)” in his nick normally and additionally the server added an extra sign on connect. But it will probably be 1 of a million.
Also I added infinite loop protection in case there are no suitable names in the list. It will just stop and use the last name after 10 tries.
Hope you won’t mind, marked as version 1.2.2.
Attached Files
File Type: sp Get Plugin or Get Source (botnames.sp - 548 views - 17.9 KB)

Last edited by FirEXE; 10-09-2010 at 10:52. Reason: Removed unneeded cvar notification.
FirEXE is offline
temp321
Junior Member
Join Date: Oct 2010
Old 11-04-2010 , 00:26   Re: Automatic Bot Names
Reply With Quote #49

I am getting spam like this that doesn't stop until someone leaves.

name "AmNot" not found
name "AmNot" not found
name "AmNot" not found
name "AmNot" not found
name "AmNot" not found

Anyone know what is wrong?
temp321 is offline
xomp
BANNED
Join Date: Jul 2008
Old 12-19-2010 , 19:55   Re: Automatic Bot Names
Reply With Quote #50

This plugin now crashes the server at random after the XMas update.

Quote:
L 12/19/2010 - 01:22:51: SourceMod error session started
L 12/19/2010 - 01:22:51: Info (map "cp_dustbowl") (file "errors_20101219.log")
L 12/19/2010 - 01:22:51: [SM] Native "GetArraySize" reported: Invalid Handle 0 (error: 4)
L 12/19/2010 - 01:22:51: [SM] Displaying call stack trace for plugin "botnames.smx":
L 12/19/2010 - 01:22:51: [SM] [0] Line 311, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach:oBotName()
L 12/19/2010 - 01:22:51: [SM] [1] Line 500, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach::Event_PlayerTeam()
L 12/19/2010 - 01:57:16: Error log file session closed.
L 12/19/2010 - 08:54:23: SourceMod error session started
L 12/19/2010 - 08:54:23: Info (map "cp_dustbowl") (file "errors_20101219.log")
L 12/19/2010 - 08:54:23: [SM] Native "GetArraySize" reported: Invalid Handle 0 (error: 4)
L 12/19/2010 - 08:54:23: [SM] Displaying call stack trace for plugin "botnames.smx":
L 12/19/2010 - 08:54:23: [SM] [0] Line 311, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach:oBotName()
L 12/19/2010 - 08:54:23: [SM] [1] Line 500, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach::Event_PlayerTeam()
L 12/19/2010 - 096:05: Error log file session closed.
L 12/19/2010 - 15:53:06: SourceMod error session started
L 12/19/2010 - 15:53:06: Info (map "cp_dustbowl") (file "errors_20101219.log")
L 12/19/2010 - 15:53:06: [SM] Native "GetArraySize" reported: Invalid Handle 0 (error: 4)
L 12/19/2010 - 15:53:06: [SM] Displaying call stack trace for plugin "botnames.smx":
L 12/19/2010 - 15:53:06: [SM] [0] Line 311, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach:oBotName()
L 12/19/2010 - 15:53:06: [SM] [1] Line 500, /home/groups/alliedmodders/forums/files/6/7/6/9/6/74512.attach::Event_PlayerTeam()
xomp is offline
Send a message via Skype™ to xomp
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:00.


Powered by vBulletin®
Copyright ©2000 - 2023, vBulletin Solutions, Inc.
Theme made by Freecode