// Attempt to open a connection to the server
ASConnection conn = (ASConnection)ASConnection.open();
if ( conn != null ) {
// A connection has been successfully open
// Find the username/password for the bot in it's spawn.ini file
LoginInfo login = SpawnConfiguration.allocateLoginInfo();
if ( login != null ) {
// The username/password for the bot has been found
// Memorize the info for further usage
conn.setLoginInfo( login );