AddBot

From King Arthur's Gold Wiki
Jump to: navigation, search

Adds a bot to the game, with the given name. Returns a reference to the bot's CPlayer object.

CPlayer@ AddBot( const string &name )

Usage example, in which saying '!bot' in the chat will cause a bot called Henry to be created:

void ProcessChat( CRules@ this, string text, CPlayer@ player ) 
if (text == "!bot")
{
  CPlayer@ bot = AddBot( "Henry" );
}