*/
protected boolean connect () {
boolean failed = true;
// 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 );
try {
// Connecting to the zone
if ( conn.connect() ) {
// The connection to the zone is in process
// The connection will be establish successfully once
// the Connected event is receive in processEvent method.
// Memorize the connection object for further usage