Author Topic: Request:random bot  (Read 908 times)

0 Members and 1 Guest are viewing this topic.

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Request:random bot
« on: November 09, 2007, 11:13:59 am »
I searched, and looked through the script releases and couldnt find it. I hav a feeling its already been done, and if it has, the please post a link. What i want it to do is make it so if you type in something like '/bot' then it adds a random bot to the server. Also (if its possible) it wouldnt only use the default bots (admiral, boogie man, etc.), it would use ANY bots that are in the C:/soldat/bots or server/bots etc. What i mean is i could add like... 500 (thats alot ;p lol) bots to the folder and want to see random ones. I wouldnt need to edit the script, i would just type /bot and it would add a bot, and it mite be one of the new ones. I phrased that weird... Basicly, it takes ANY bot in your soldat/bots folder and adds it to the game on /bot.
help?

1221995

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Request:random bot
« Reply #1 on: November 09, 2007, 08:16:38 pm »
http://www.enesce.com/help/index.html?Functions/RandomBot.html
It says it will do any bot file in the bots folder.
Just a small admin command:
Code: [Select]
function OnCommand(ID: Byte; Text: string): boolean;
begin
  try
    if (LowerCase(Copy(Text,1,4)) = '/bot') and (Length(Text) <= 5) then Command('/addbot' + InttoStr(Text[5]) + ' ' + RandomBot);
  except
  end;
end;

The try could be better placed, but i was a bit lazy :) just threw this together.. You can do Text[5] to get the 5th character of Text, right?

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Request:random bot
« Reply #2 on: November 09, 2007, 10:14:38 pm »
Also, RandomBot ignores Boogie Man and Dummy bot files.

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Request:random bot
« Reply #3 on: November 10, 2007, 01:18:48 am »
Mmmmm... Thats pretty cool ;p im getting rite now :D ...

Ok thx :) it works  ;D
« Last Edit: November 10, 2007, 01:27:53 am by 1221995 »