Author Topic: Automatic Bot Adder  (Read 1130 times)

0 Members and 1 Guest are viewing this topic.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Automatic Bot Adder
« on: June 20, 2008, 08:37:08 am »
I need a script that add bots when player join. I want to use it on a zombiematch.

I imagine it like this :

When first player join, 7 bots are added. Next join add 2 zombies(2 player = 9 bots, 3p = 11b, 4p = 13b,...)...
When player leaves server 2 bots are kicked, and if the server is empty, all bots are kicked.
In 'data.ini'(file with script) you can set how many bots are added in first join, rest of joins, and bot name.

I tried to do it myself, but I realy suck in scripting.


Can someone make this script, or tell me how to do it ?
I search it but i don't find anything

Offline Centurion

  • Flagrunner
  • ****
  • Posts: 699
Re: Automatic Bot Adder
« Reply #1 on: June 20, 2008, 09:49:38 am »
Yea. It can be done. But I don't know how. Sorry. Let's wait for some skilled scripters

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Automatic Bot Adder
« Reply #2 on: June 21, 2008, 03:05:47 pm »
Please, if you(everyone who is reading this) are skilled in scripting, help me  :-\

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Automatic Bot Adder
« Reply #3 on: June 21, 2008, 03:12:14 pm »
I can do that in about 5 minutes, give me a few and I'll pm it to you.

EDIT: it's giving me a random bug for the first person to join the game, so this might take a bit longer. Someone could probably do it faster than I will >_>
« Last Edit: June 21, 2008, 03:33:29 pm by Iq Unlimited »

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: Automatic Bot Adder
« Reply #4 on: June 21, 2008, 04:34:07 pm »
Well, I haven't tested (or even tried to compile) it, but it should do the trick. No neat features, though. And there are some obvious problems with it, like what would happen if Alpha had more than 9 players. At least it shows one way to do it.

Code: [Select]
procedure AppOnIdle(Ticks: Integer);
var i, j: Integer;
begin

  if AlphaPlayers > 0 then
    j := 5 + (AlphaPlayers * 2)

  while BravoPlayers < j do
    Command('/addbot2 Boogie Man');

  while BravoPlayers > j do
    for i := 1 to 32 do
      if GetPlayerStat(i, 'Active') then
        if GetPlayerStat(i, 'Human') = false then
          if GetPlayerStat(i, 'Team') = 2 then
            Command('/kick ' + inttostr(i));
       
end;

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: Automatic Bot Adder
« Reply #5 on: June 22, 2008, 01:58:38 am »
Thanks, your script is working  ;D