Updated to PircBot 1.4.6 and added support for NickServ password identification using PircBot's identify(password) method.

This commit is contained in:
Erik C. Thauvin 2007-07-19 06:16:38 +00:00
parent 760a2074e5
commit 4d1995ff2c
7 changed files with 126 additions and 100 deletions

View file

@ -459,6 +459,11 @@ public class Mobibot extends PircBot
*/
private String _identNick = "";
/**
* The NickServ ident password.
*/
private String _ident = "";
/**
* The ignored nicks array.
*/
@ -583,7 +588,7 @@ public class Mobibot extends PircBot
options.addOption(HELP_ARG.substring(0, 1), HELP_ARG, false, "print this help message");
options.addOption(DEBUG_ARG.substring(0, 1), DEBUG_ARG, false,
"print debug & logging data directly to the console");
options.addOption(OptionBuilder.withArgName("file").hasArg().withDescription("use alternate properties file")
options.addOption(OptionBuilder.hasArg().withDescription("use alternate properties file")
.withLongOpt(PROPS_ARG).create(PROPS_ARG.substring(0, 1)));
// Parse the command line
@ -697,6 +702,7 @@ public class Mobibot extends PircBot
final String ignoredNicks = p.getProperty("ignore", "");
final String identNick = p.getProperty("ident-nick", "");
final String identMsg = p.getProperty("ident-msg", "");
final String ident = p.getProperty("ident", "");
final String tags = p.getProperty("tags", "");
// Get the del.icio.us properties
@ -714,6 +720,9 @@ public class Mobibot extends PircBot
bot.setVersion(weblogURL);
bot.setMessageDelay(MESSAGE_DELAY);
// Set the ident password
bot.setIdent(ident);
// Set the ident nick and message
bot.setIdentNick(identNick);
bot.setIdentMsg(identMsg);
@ -774,6 +783,13 @@ public class Mobibot extends PircBot
bot.setVersion(INFO_STRS[0]);
// Identify with NickServ
if (isValidString(ident))
{
bot.identify(ident);
}
// Identify with a specified nick
if (isValidString(identNick) && isValidString(identMsg))
{
bot.sendMessage(identNick, identMsg);
@ -1142,6 +1158,11 @@ public class Mobibot extends PircBot
setVersion(INFO_STRS[0]);
if (isValidString(_ident))
{
identify(_ident);
}
if (isValidString(_identNick) && isValidString(_identMsg))
{
sendMessage(_identNick, _identMsg);
@ -2800,6 +2821,17 @@ public class Mobibot extends PircBot
_googleKey = googleKey;
}
/**
* Sets the ident password.
*
* @param pwd The password.
*/
private void setIdent(String pwd)
{
_ident = pwd;
}
/**
* Sets the ident message.
*

View file

@ -1,5 +1,5 @@
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
/* Creation date Mon Apr 16 15:39:07 GMT 2007 */
/* Creation date Wed Jul 18 23:09:10 PDT 2007 */
package net.thauvin.erik.mobibot;
import java.util.Date;
@ -20,31 +20,21 @@ public class ReleaseInfo {
}
/** buildDate (set during build process to 1176737947817L). */
private static final Date buildDate = new Date(1176737947817L);
/** buildDate (set during build process to 1184825350594L). */
private static final Date buildDate = new Date(1184825350594L);
/**
* Get buildDate (set during build process to Mon Apr 16 15:39:07 GMT 2007).
* Get buildDate (set during build process to Wed Jul 18 23:09:10 PDT 2007).
* @return Date buildDate
*/
public static Date getBuildDate() { return buildDate; }
/**
* Get buildNumber (set during build process to 68).
* Get buildNumber (set during build process to 70).
* @return int buildNumber
*/
public static int getBuildNumber() { return 68; }
/** version (set during build process to "0.3"). */
private static final String version = "0.3";
/**
* Get version (set during build process to "0.3").
* @return String version
*/
public static String getVersion() { return version; }
public static int getBuildNumber() { return 70; }
/** project (set during build process to "mobibot"). */
@ -56,4 +46,14 @@ public class ReleaseInfo {
*/
public static String getProject() { return project; }
/** version (set during build process to "0.3"). */
private static final String version = "0.3";
/**
* Get version (set during build process to "0.3").
* @return String version
*/
public static String getVersion() { return version; }
}