diff --git a/mobibot.iws b/mobibot.iws index 75a8105..3b59918 100644 --- a/mobibot.iws +++ b/mobibot.iws @@ -108,7 +108,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -126,7 +126,7 @@ - + @@ -149,7 +149,7 @@ - + @@ -158,7 +158,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -189,20 +189,20 @@ - - + + - + + + + - - - - + @@ -330,7 +330,7 @@ - + @@ -341,7 +341,7 @@ - + @@ -471,7 +471,7 @@ - + @@ -480,7 +480,7 @@ - + @@ -489,7 +489,7 @@ - + @@ -512,7 +512,7 @@ - + @@ -521,7 +521,7 @@ - + @@ -530,7 +530,7 @@ - + diff --git a/src/net/thauvin/erik/mobibot/Mobibot.java b/src/net/thauvin/erik/mobibot/Mobibot.java index 134c098..2bb7821 100644 --- a/src/net/thauvin/erik/mobibot/Mobibot.java +++ b/src/net/thauvin/erik/mobibot/Mobibot.java @@ -80,7 +80,7 @@ public class Mobibot extends PircBot */ private static final String[] INFO_STRS = { - "Mobibot v0.1.3b3 by Erik C. Thauvin (erik@thauvin.net)", + "Mobibot v0.1.3b4 by Erik C. Thauvin (erik@thauvin.net)", "" }; @@ -630,6 +630,7 @@ public class Mobibot extends PircBot // Initialize the bot bot.setVerbose(true); + bot.setAutoNickChange(true); bot.setName(nickname); bot.setLogin(login); bot.setVersion(weblogURL); @@ -651,31 +652,14 @@ public class Mobibot extends PircBot { int retries = 0; - while ((retries < MAX_RECONNECT) && !bot.isConnected()) + while ((retries++ < MAX_RECONNECT) && !bot.isConnected()) { sleep(10); - if ((retries > 0) && (e instanceof NickAlreadyInUseException)) - { - bot.setName(nickname + retries); - } - - retries++; - try { bot.connect(server); } - catch (NickAlreadyInUseException ex) - { - if (retries == MAX_RECONNECT) - { - System.err.println("Unable to connect to " + server + " after " + MAX_RECONNECT + - " retries. Nickname already in use."); - e.printStackTrace(System.err); - System.exit(1); - } - } catch (Exception ex) { if (retries == MAX_RECONNECT) @@ -992,30 +976,14 @@ public class Mobibot extends PircBot { int retries = 0; - while ((retries < MAX_RECONNECT) && !isConnected()) + while ((retries++ < MAX_RECONNECT) && !isConnected()) { sleep(10); - if ((retries > 0) && (e instanceof NickAlreadyInUseException)) - { - setName(getNick() + retries); - } - - retries++; - try { connect(_ircServer); } - catch (NickAlreadyInUseException ex) - { - if (retries == MAX_RECONNECT) - { - _logger.debug("Unable to reconnect to " + _ircServer + " after " + MAX_RECONNECT + - " retries. Nickname already in use.", e); - System.exit(1); - } - } catch (Exception ex) { if (retries == MAX_RECONNECT)