Bitfighter  021
The Bitfighter Lua Documentation - Robots, Levelgens, and Plugins
Robot Overview

Introduction

A robot's main() function gets run as soon as the bot is added to the game. In the main function, the bot should subscribe to any events it wants to listen for (though it can always subscribe later). By default, all bots are subscribed to the Tick event, though you can unsbscribe to that event if the bot only responds to events (eliza.bot works this way – in its main function, it subscribes to the MsgRecieved event, and unsbscribes to Tick.)

Step 1: Opening the box

When the bot is first started, Bitfighter will call the bot's getName() function. This function should return a string which will be used as the bot's name. If the function is not implemented, or returns a nil, the bot will be assigned a name. If getName() returns any other value, an error will be logged, and the script will be terminated. Once the bot's name has been specified, it cannot be changed.

A very simple getName() function might look like this:

function getName()
return("Asimov")
end