Raised This Month: $32 Target: $400
 8% 

SpecBot 2021


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Server Management       
Darian433
Junior Member
Join Date: Dec 2021
Old 12-18-2021 , 10:41   SpecBot 2021
Reply With Quote #1

Hi! I was looking a lot for a spec bot plugin that was not detected as "bots" but most of them crashed the server, so I created one with a friend and i want to share it with you. (yes, i know there are many plugins but none of it worked like this without crashing the server).
The plugin is writed using amx 1.9.
Credits: ideea from the internet - written by me and SendOreos

General information:
The plugin simply adds 3 bots to the spec (the names of the bots are custom via cvars) that never joins the team. They will disconnect and reconnect automatically. (one at a time).
More informations here (english soon): click

Cvars:
bs_enable "0/1" - enable / disable the plugin
bs_botname "name1" - name of the first bot
bs_botname2 "name2" - bot of the second bot
bs_botname3 "name3" - bot of the third bot
bs_maxplayers "5-29" - when to disconnect, disconnect happens at the number +1 and reconnects at -1 (ex. 28 online players, only 1 bot will connect, when the 29 player connect the bot will disconnect).
Attached Files
File Type: sma Get Plugin or Get Source (botspec.sma - 277 views - 4.0 KB)
Darian433 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-19-2021 , 08:16   Re: SpecBot 2021
Reply With Quote #2

Plugins of this sort typically get get trashed or unapproved.
__________________

Last edited by DJEarthQuake; 12-20-2021 at 00:46.
DJEarthQuake is offline
Darian433
Junior Member
Join Date: Dec 2021
Old 12-20-2021 , 01:04   Re: SpecBot 2021
Reply With Quote #3

Quote:
Originally Posted by DJEarthQuake View Post
Plugins of this sort typically get get trashed or unapproved.
Posted to help people, so i don't really need to be approved, only to be here so they can use it.
Darian433 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-21-2021 , 02:14   Re: SpecBot 2021
Reply With Quote #4

Everyone give the help to others on this forum but we in 2022, we should make plugin with optimized code.
I did search and i found much plugin for spec bot with more features
P.s: We don't mean to give bad feedback but we are trying to do our best for this game.

- I learned something from some scripter's here: Why we creating plugin has like 1000 line using hard coded and we can create it with less lines like 300 with more feature with optimizing the code.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Darian433
Junior Member
Join Date: Dec 2021
Old 12-24-2021 , 09:25   Re: SpecBot 2021
Reply With Quote #5

Quote:
Originally Posted by Supremache View Post
Everyone give the help to others on this forum but we in 2022, we should make plugin with optimized code.
I did search and i found much plugin for spec bot with more features
P.s: We don't mean to give bad feedback but we are trying to do our best for this game.

- I learned something from some scripter's here: Why we creating plugin has like 1000 line using hard coded and we can create it with less lines like 300 with more feature with optimizing the code.
You searched but didn't tested, test the plugins in 1.9 and comeback with a feedback, there a difference between this plugin that is not detected as a bot and the plugins that are detected.
Anyway, im open to optimize the code, im waiting for proposals.
Darian433 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-24-2021 , 17:03   Re: SpecBot 2021
Reply With Quote #6

Quote:
Originally Posted by Darian433 View Post
You searched but didn't tested, test the plugins in 1.9 and comeback with a feedback, there a difference between this plugin that is not detected as a bot and the plugins that are detected.
Anyway, im open to optimize the code, im waiting for proposals.
I actually found this plugins and i think they works fine
When i have time i will create this plugin with many features with code optimized
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Darian433
Junior Member
Join Date: Dec 2021
Old 12-25-2021 , 06:08   Re: SpecBot 2021
Reply With Quote #7

Quote:
Originally Posted by Supremache View Post
I actually found this plugins and i think they works fine
When i have time i will create this plugin with many features with code optimized
You found and you only "THINK" but you didn't read that the plugin is from 2016, that's the first thing, second thing some of you guys do "work" only when someone try to do something. I shared something that i didn't found on the internet to work as i wanted.

Please, stop replying unless you come with something for the code.
Darian433 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-25-2021 , 06:46   Re: SpecBot 2021
Reply With Quote #8

That plugin may be from 2016 but this one looks like it was coded in the early 2000s.

Apart from you using this as an obvious advertisement, the code can use tons of improvements.

The main problem is using repetitive code everywhere. All of this can be handled with a simple loop. I'd give this plugin max 30 lines of actual code, excluding the plugin registration stuff.

You're limiting the entire plugin for AMXX 1.9+ because of one line of code that can easily be made compatbile with older versions.

You're also limiting your plugin to exactly 3 bots when you can do this the non-hardcoded way and allow for full flexibility.

You have a non-functioning cvar "bs_enable" because you're getting its value in plugin_init(). Cvars are read in plugin_cfg() which is executed after plugin_init().

Apart from that, there are many minor things that can be worked on:

Code:
new bool:bot_on, bot_on2, bot_on3;

Why is just the first variable a boolean?
Why do you even have a separate variable for each bot?

Code:
// Sets bot connection confirmations off on each map change bot_on = false; bot_on2 = false; bot_on3 = false;

Since when do variables get saved on map change?

Code:
// Checks and connects bots every 60s if requirements are met     if(get_pcvar_num(g_pEnable)) {         set_task(60.0, "AddBots", 0, _, _, "b");     }

Why 60 seconds and not when a player joins/leaves?

Code:
new szBotName[35]

The maximum name length is 32.
Also, why the separate variables when you can just override the first one?

Code:
server_cmd("kick ^"%s^"", szBotName);

Why would you use kick with the name instead of the bot's id?
What happens if a player decides to use one of the bots' names?

Code:
if(get_playersnum(1) < get_pcvar_num(g_pMaxPlayers) && !bot_on)

"bot_on" should be checked first. There's no reason to call any natives if the variable didn't pass the logical test.

Code:
// Adds up to 3 bots if they're not connected and there's less players than the threshold public AddBots() {     if(get_playersnum(1) < get_pcvar_num(g_pMaxPlayers) && !bot_on) {         AddBot();         if(get_playersnum(1) < get_pcvar_num(g_pMaxPlayers) && !bot_on2) {             AddBot2();             if(get_playersnum(1) < get_pcvar_num(g_pMaxPlayers) && !bot_on3) {                 AddBot3();             }         }     } }

Why the need to keep calling the same function over and over again? You already got the number the first time, just add +1 and reuse it.

Code:
new szMsg[128]; dllfunc(DLLFunc_ClientConnect, id, szBotName, "127.0.0.1", szMsg);

You're not using the message, why get it in the first place?

And last, but not least, what happened to the author's name? If you're going to use someone else's code you should give credits for it.
__________________

Last edited by OciXCrom; 12-25-2021 at 06:49.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 12-25-2021 , 06:53   Re: SpecBot 2021
Reply With Quote #9

Quote:
Originally Posted by Supremache View Post
Everyone give the help to others on this forum but we in 2022, we should make plugin with optimized code.
I did search and i found much plugin for spec bot with more features
P.s: We don't mean to give bad feedback but we are trying to do our best for this game.
is not meaning if is it old then it's bad, With that code you have created can some glitches happen like if some one used this plugin and used code for making the users join a team automatically the bot will also move to random team do you expect what will happen then ? if your answer "Should disable the bots from auto join team source" i think no one of who has not experience can do this.

Respect any feedback and ask for the point who type a bad feedback of view, anyway good luck.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.
Supremache is offline
Darian433
Junior Member
Join Date: Dec 2021
Old 12-25-2021 , 07:16   Re: SpecBot 2021
Reply With Quote #10

Maybe you understood me wrong, anyway, the idea is that gametrackers doesn't allow more than 3 bots, so that's why we added only 3. We are using this bot plugin and auto join and we don't have problems, the bot's stays on spec.
P.S: on our forum we don't support english, so i don't think there is a really advertisement (it doesn't help us).

Thanks for the feedback, we will come with an update in 2022 January.
Happy hollydays!
Darian433 is offline
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 12:24.


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