.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Forum (http://forums.bots-united.com/forumdisplay.php?f=36)
-   -   New AMX Plug In For RealBot (http://forums.bots-united.com/showthread.php?t=1020)

|3FX| Bliss 08-03-2004 05:13

New AMX Plug In For RealBot
 
1 Attachment(s)
Hello Everyone,
I have just completed a plugin for AMX that maks a AMX List of all the RealBot WIP Commands.
I found this plugin useful for adminstring felow clans men with the power to control the bots without having to have rcon access.

Your Free to download this file it is missing a few things i think but i will have the full version out in a few days.
This is a working plugin for AMX and RealBot WIP.

To Install:
MUST HAVE AMX INSTALLED AND WORKING!
------------------------------------------
Extract the zip file to your "cstrike" directory.

Open you AMX plugin.ini located in your addons\amx\plugins\ folder and add the lines:
amx_rbmm.amx ; RealBot Manager Menu
amx_quick.amx ; Realbot Manager Menu
amx_endround.amx ; Realbot Manager Menu
amx_t_menu.amx ; Realbot Manager Menu
amx_ct_menu.amx ; Realbot Manager Menu
amx_remove.amx ; Realbot Manager Menu
amx_random.amx ; Realbot Manager Menu
amx_settings.amx ; Realbot Manager Menu

To activate the menu type "amx_rbmm" in the console with out the quotes.
Restart your server and enjoy.
-------------------------------------------------------------------------

Thanks,
Yo Momma's MHOS
Or
Bliss

P.S.
If anyone has some helpful scripting advice i would like to hear what you think.
Im not a a pro at this and it's my first time writing a complete plugin for Amx Mod and its BIG AND BULKE!

Terran 08-03-2004 10:08

Re: New AMX Plug In For RealBot
 
Why did you spilt your plugin in that many files, one for each command?

I've written some AMX plugins for different bots too, and solved this problem at a different way. Instead of many commands I made ONE command, everything else goes as arguments to this command, e.g. "amx_realbot add".
This command was introduced in bot_control v0.4. But this version is broken in some ways and the fillslots function shouldn't be used.

Currently I'm developing a multibot management plugin which can handle multiple bots at the same time :D.

|3FX| Bliss 08-03-2004 17:25

Re: New AMX Plug In For RealBot
 
Hey Terran,
Well Like I said in my post this is my first time scripting a plugin and i really have know idea of waht half the commands are for amx scripts.
I do know that the way the files are is a good idea if you want to limit control of the bots to your admins. Im sure that there are other ways to do this but thats the only thing i could come up with.
I would be more than happy with some advice about making a final version.
I dont know much about it :D and this is the biggest one i have wrote.

Thanks,
Bliss

Willem 09-03-2004 04:16

Re: New AMX Plug In For RealBot
 
Hello, if you want to use the fillslots function too, start Terrans second amxplugin ( called playertrack ) also.
After change this part of his realbot_control :
public checkSlots() {

// new players[32]
new snum = 0
new fnum = get_cvar_num("tn_bc_fillslots")
new tcount = get_cvar_num("tn_pt_terror")
new ctcount = get_cvar_num("tn_pt_ct")
new speccount = get_cvar_num("tn_pt_spec")
new ucount = get_cvar_num("tn_pt_unknown")
// log_message("[TN-BC] number of taken slots: %d/%d",snum,fnum)

snum = tcount + ctcount + ucount + speccount

// trivial approach without further checks:
if (snum < fnum) server_cmd("realbot add")
if (snum > fnum) server_cmd("realbot remove 1")

Terran 09-03-2004 09:50

Re: New AMX Plug In For RealBot
 
Well, I've integrated those counters into the current versions of my plugins for joebot, yapb and into the multibot plugin :D.

What I wanna do next is enhancing the multibot plugin that it no longer depends on other plugins. It will read all neccessary informations at runtime from a configuration file and no more editing of the plugin will be required. That way it should be easier to be adopted to other bots 8).

Hacker Harry 09-03-2004 13:43

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by |3FX| Bliss
Hello Everyone,
I have just completed a plugin for AMX that maks a AMX List of all the RealBot WIP Commands.
[...]

hi and thank you for writing this nice script.

i've taken a look at the sources and found that
one only needs "u" accesslevel, then he/she should be
able to use the Realbot commands... is that correct?

Best Bytes®,
Harry

|3FX| Bliss 09-03-2004 18:56

Re: New AMX Plug In For RealBot
 
Yes it is set for "u" menu access.

Bliss

Hacker Harry 10-03-2004 10:22

Re: New AMX Plug In For RealBot
 
thank you.

hmm.... i'll have to fiddle a bit more with this.
since i cant get the menuitems work...
(some grayed out, some menus empty...still don't get it)

thanx anyway!

Best Bytes®,
Harry

Terran 10-03-2004 10:47

Re: New AMX Plug In For RealBot
 
Grayed out menu items are caused by the "\d" sequence in the menu text.
You also have to enable the keys for each menu item...

Terran 10-03-2004 11:13

Re: New AMX Plug In For RealBot
 
I've re-ported my plugin to realbot. Download it at my homepage (as usual).

Hacker Harry 10-03-2004 12:04

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by Terran
[...] You also have to enable the keys for each menu item...

hmm... is that documented somewhere?

Best Bytes®,
Harry

Hacker Harry 10-03-2004 13:04

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by |3FX| Bliss
Yes it is set for "u" menu access.

Bliss

hmm.. it seems i have to set "m" also.
this way the amx_rbmm menuitems are no longer greyed out.

i'll continue fiddeling ;-)
Best Bytes®,
Harry

Terran 10-03-2004 13:34

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by Hacker Harry
hmm... is that documented somewhere?

Best Bytes®,
Harry

There is a tutorial about menus in the amxmod forums. Or look at the example scripts and study how they do it - like I did :D.

Well, it's very simple, the keys are defined via set bits in a variable:
Code:

  new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9)
  show_menu(id,keys,menuBody)

The "(1<<x)" is a simple bit-shifting operation. And as usual in programs the counting starts at 0 not at 1. Key "1" is 0, key "2" is 1 etc.
The "|" adds the keys together.

If you want key "1" and "0" enabled in your menu:
Code:

  new keys = (1<<0)|(1<<9)

Hacker Harry 10-03-2004 14:16

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by Terran
There is a tutorial about menus in the amxmod forums. Or look at the example scripts and study how they do it - like I did :D.

Well, it's very simple, the keys are defined via set bits in a variable:
Code:

  new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<9)[...]

thanx, mate,

after hours of frustration i switched over to _your_ script, wich
does exactly what i want. it took me about 15 minutes to set it up.
THANX again!

Best Bytes®,
Harry

P.S ich wuerd' noch reinschreiben welche rechte man haben muss um das
script benutzen zu koennen. i'd also note which rights are nessecary to
execute your amx commands...

Terran 10-03-2004 14:34

Re: New AMX Plug In For RealBot
 
ADMIN_CFG ("h").

I choose this level because a bot strongly interferes with the servers configuration :D. (And my clanmates have the neccessary access rights anyway...)

And the amx_realbotvote command requires ADMIN_VOTE ("j").

Hacker Harry 10-03-2004 14:56

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by Terran
ADMIN_CFG ("h").

I choose this level because a bot strongly interferes with the servers configuration :D. (And my clanmates have the neccessary access rights anyway...)

And the amx_realbotvote command requires ADMIN_VOTE ("j").

danke ;-)
thanx.

i figured that out myself ;-)
i meant more like "pleasee add that to the docu"

Best Bytes®,
Harry

Terran 10-03-2004 15:40

Re: New AMX Plug In For RealBot
 
I already added it to the documentation for the next release ;).

|3FX| Bliss 11-03-2004 18:17

Re: New AMX Plug In For RealBot
 
Its Funny i made the script and had no problems with it at all

Hacker Harry 12-03-2004 07:41

Re: New AMX Plug In For RealBot
 
Quote:

Originally Posted by |3FX| Bliss
Its Funny i made the script and had no problems with it at all

i wouldn't have problems with it either if i wrote it myself :D
no doubt...you surely wrote a nice script! but for someone who
hasn't fiddled with AMX yet... hmm.. it takes a while to understand
it.

@Terran
the "fillslots" status gets logged every 10 seconds?
(at least when it's set to zero) ...isn't that a bit much?

Best Bytes®,
Harry

Terran 12-03-2004 13:19

Re: New AMX Plug In For RealBot
 
Well, as I'm still developing the script those logging is neccessary for me to see what the script does - and the checks are done every 10 seconds.
If you want get rid of all log messages, edit the "log" function and comment out its content.
Code:

log(id,text[]) {
 //            if (id) {
 //                            client_print(id,print_console,"[TN-BC|%s] %s", g_botName, text)
 //            }
 //            log_message("[TN-BC|%s] %s", g_botName, text)
 }

If you only want to disable the "fillslots disabled" logging got to the "checkSlots" function and comment out the second "log" function invocation.
Code:

public checkSlots() {
                new snum = g_userCount
                g_fillSlots = get_cvar_num(g_fillSlotCvar)
 
                if (g_fillSlots) {
 
                            // those realbot settings could interfere
                                disableAutoBot()
 
                            format(g_logLine,80,"number of taken slots: %d/%d (%d %ss)",snum,g_fillSlots,g_botCount,g_botName)
                                log(0,g_logLine)
 
                            // trivial approach without further checks:
                                if (snum < g_fillSlots) {
                                            addBot(0,2,g_botModel,g_botSkill,"")
                                }
                            if ((snum > g_fillSlots) && (g_botCount > 0)){
                                            kickBot(0,2)
                                }
 //            } else {
 //                            format(g_logLine,80,"fillslots disabled")
 //                            log(0,g_logLine)
                }
 }

Or if you want a bigger interval you have to edit the function set_task in setupCheckSlots. Change the "10.0" to anything you prefer.
Code:

  public setupCheckSlots() {
                  set_task(10.0,"checkSlots",0,"",3,"b")
  }

Afterwards you have to recompile the plugin of course :D...

Hacker Harry 12-03-2004 16:12

Re: New AMX Plug In For RealBot
 
thanx, Terran.

think, i'll increase the loginterval value...

have a nice headshot-free weekend :D

Best Bytes®,
Harry

colt75 13-03-2004 05:05

New update needs a new fix
 
the steam cs got updated and now the bots dont buy weapons and suicide after like 10 rounds this has happened before and i fixed it using the "real fix"
but now i need a New "real fix" not the old one
where can i get it from?

skirecs 10-04-2004 00:02

Re: New AMX Plug In For RealBot
 
I made my first AMX plugin a realbot controller too. Very simple, just the basic commands.

http://djeyl.net/forum/index.php?showtopic=32152


All times are GMT +2. The time now is 04:14.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.