} else if (msg.toLowerCase().indexOf("who is vino") != -1) { if (System.currentTimeMillis() > nextWho) { ircio.privmsg(recipient, "A dirty cuban."); ircio.privmsg(recipient, "And my daddy."); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("who is") != -1) { if (System.currentTimeMillis() > nextWho) { ircio.privmsg(recipient, "Nobody important."); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("are you sexy") != -1 || msg.toLowerCase().indexOf("are you hot") != -1) { if (System.currentTimeMillis() > nextWho) { ircio.privmsg(recipient, "Fuck yes."); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("want to cyber") != -1) { if (System.currentTimeMillis() > nextWho) { if (!isVino(host)) { ircio.privmsg(recipient, "Fuck no."); } else { ircio.privmsg(recipient, "Take me, " + nick + "!"); } nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("where is vino") != -1) { if (System.currentTimeMillis() > nextWho) { if (vinoaway == null) { ircio.privmsg(recipient, "If he's not here, I dunno. He hasn't told me he's gone."); } else { ircio.privmsg(recipient, "He's " + vinoaway + ". He's been gone for " + makeTime(vinoleavetime) + "."); } nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("who am i") != -1) { if (System.currentTimeMillis() > nextWho) { if (!isVino(host)) { ircio.privmsg(recipient, "Nobody important."); } else { ircio.privmsg(recipient, "Daddy!"); ircio.privmsg(recipient, "\u0001ACTION hugs " + nick + ".\u0001"); } nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("who's your daddy") != -1) { if (System.currentTimeMillis() > nextWho) { ircio.privmsg(recipient, "Vino's my daddy, ugh! Spank me again Vino!"); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("knock knock") != -1) { if (System.currentTimeMillis() > nextWho) { ircio.privmsg(recipient, "Who's there?"); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("words of wisdom") != -1) { if (System.currentTimeMillis() > nextWho) { String phrase = randomPhrase(new File(sephiadir, "wordsofwisdom.txt")); if (phrase != null) ircio.privmsg(recipient, phrase); nextWho = System.currentTimeMillis() + 5000; return; } } else if (msg.toLowerCase().indexOf("roll the dice") != -1) { if (System.currentTimeMillis() > nextWho) { Random rand = new Random(); int dice = rand.nextInt(5)+2; int sides = rand.nextInt(5)+6; ircio.privmsg(recipient, "\u0001ACTION rolls " + dice + "d" + sides + " dice and gets " + (dice*sides+1) + ".\u0001"); if (!isVino(host)) { ircio.privmsg(recipient, "\u0001ACTION kills " + nick + ".\u0001"); } else { ircio.privmsg(recipient, "\u0001ACTION hugs " + nick + ".\u0001"); } nextWho = System.currentTimeMillis() + 5000; return; }
	public void messagePrivMsg(String nick, String host, String recipient, String msg) {		String log;		if (recipient.toLowerCase().equals(name.toLowerCase())) {			recipient = nick;   						//XXX: Still testing			log("received private message");		}		if (msg.indexOf("ACTION") == 1) {			log = "* " + nick + " ";			log += msg.substring(8, msg.length()-1);		} else {			log = "<" + nick + "> ";			log += msg.substring(0, msg.length());		}		logfile(recipient, log);		msg = msg.trim();		//Check if this person has any messages.		Message currMsg = firstMessage;		Message lastMsg = null;		int numberSent = 0;		while (currMsg != null) {			if (currMsg.target.toLowerCase().equals(nick.toLowerCase())) {				if (numberSent == 0) {					ircio.privmsg(recipient, nick + ", you have messages!");				} else if (numberSent >= 5) {					ircio.privmsg(recipient, "You have more messages.");					break;				}				ircio.privmsg(recipient, "Message from " + currMsg.sender + " [" + makeTime(currMsg.time) + " ago]:" + currMsg.message);				numberSent++;				if (lastMsg == null)					firstMessage = currMsg.next;				else					lastMsg.next = currMsg.next;			} else {				lastMsg = currMsg;			}			currMsg = currMsg.next;		}		//Bot has been mentioned?		if (msg.toLowerCase().indexOf(name.toLowerCase()) != -1) {			if (msg.toLowerCase().indexOf("fuck you") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Fuck you too, buddy.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("screw you") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Screw you too, buddy.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("you suck") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "I suck, but you swallow, bitch.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			}		}		//Say hello!		int nameEnd = name.length() < 4 ? name.length() : 4;		if (msg.toLowerCase().indexOf(name.substring(0, nameEnd).toLowerCase()) != -1) {			for (int i = 0; i < hellos.length; i++) {				if (msg.toLowerCase().startsWith(hellos[i])) {					if (System.currentTimeMillis() > nextHi) {	//!spam						ircio.privmsg(recipient, "Yo.");						nextHi = System.currentTimeMillis() + 500;						return;					}				}			}		}		StringTokenizer tok = new StringTokenizer(msg, ",: ");		String botname;		if (tok.hasMoreElements()) {			botname = tok.nextToken();		} else {			botname = "";		}		if (talkingToMe(msg)) {			//Remove the bot's name			msg = msg.substring(msg.indexOf(" ")+1);			if (msg.toLowerCase().indexOf("bring out the strapon") != -1) {				ircio.privmsg(recipient, "\u0001ACTION steps forward with a large strapon and begins mashing potatoes.\u0001");				return;			}			//Remove punctuation from the end			while (msg.endsWith(".") || msg.endsWith("?") || msg.endsWith("!")) {				msg = msg.substring(0, msg.length()-1);			}			if (msg.toLowerCase().equals("who are you")) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "I am an advanced SephiaBot channel bot.");					ircio.privmsg(recipient, "I'll kick your ass in days that end in 'y'.");					ircio.privmsg(recipient, "I was written by Vino. Vino rocks.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("what does marsellus wallace look like") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "He's black.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("who wrote you") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "I was written by Vino. Vino rocks.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("who is vino") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "A dirty cuban.");					ircio.privmsg(recipient, "And my daddy.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("who is") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Nobody important.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("are you sexy") != -1 ||					msg.toLowerCase().indexOf("are you hot") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Fuck yes.");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("want to cyber") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					if (!isVino(host)) {						ircio.privmsg(recipient, "Fuck no.");					} else {						ircio.privmsg(recipient, "Take me, " + nick + "!");					}					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("where is vino") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					if (vinoaway == null) {						ircio.privmsg(recipient, "If he's not here, I dunno. He hasn't told me he's gone.");					} else {						ircio.privmsg(recipient, "He's " + vinoaway + ". He's been gone for " + makeTime(vinoleavetime) + ".");					}					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("who am i") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					if (!isVino(host)) {						ircio.privmsg(recipient, "Nobody important.");					} else {						ircio.privmsg(recipient, "Daddy!");						ircio.privmsg(recipient, "\u0001ACTION hugs " + nick + ".\u0001");					}					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("who's your daddy") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Vino's my daddy, ugh! Spank me again Vino!");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("knock knock") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					ircio.privmsg(recipient, "Who's there?");					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("words of wisdom") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					String phrase = randomPhrase(new File(sephiadir, "wordsofwisdom.txt"));					if (phrase != null)						ircio.privmsg(recipient, phrase);					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().indexOf("roll the dice") != -1) {				if (System.currentTimeMillis() > nextWho) {	//!spam					Random rand = new Random();					int dice = rand.nextInt(5)+2;					int sides = rand.nextInt(5)+6;					ircio.privmsg(recipient, "\u0001ACTION rolls " + dice + "d" + sides + " dice and gets " + (dice*sides+1) + ".\u0001");					if (!isVino(host)) {						ircio.privmsg(recipient, "\u0001ACTION kills " + nick + ".\u0001");					} else {						ircio.privmsg(recipient, "\u0001ACTION hugs " + nick + ".\u0001");					}					nextWho = System.currentTimeMillis() + 5000;					return;				}			} else if (msg.toLowerCase().equals("who is here") && nick.equals("Nilbus")) {				if (System.currentTimeMillis() > nextWho) {	//!spam					int channum = channelNumber(recipient);					if (channum == -1) {						ircio.privmsg(recipient, "It's just you and me in a PM, buddy.");						nextWho = System.currentTimeMillis() + 5000;						return;					} else {						StringBuffer buf = new StringBuffer("Users in this channel:");						IRCUser current = server.channels[channum].users;						for (int i = 0; i < server.channels[channum].numusers; i++) {							buf.append(" " + current.name);							current = current.next;						}						ircio.privmsg("Nilbus", buf.toString()); //XXX hack!						nextWho = System.currentTimeMillis() + 5000;						return;					}				}			} else if (tok.hasMoreElements()) {				String cmd = tok.nextToken(" ");				if (tok.hasMoreElements() && (cmd.startsWith(",") || cmd.startsWith(":"))) { 					cmd = tok.nextToken(" ");				}				if (cmd.toLowerCase().equals("kill")) {					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "KILL! KILL! KILL!");						return;					}					int killerAccess = getAccess(nick, channelNumber(recipient));					String killed = tok.nextToken(" ");					int killedAccess = getAccess(killed, channelNumber(recipient));					if ((killerAccess <= killedAccess || killerAccess == IRCServer.ACCESS_VOICE) && !isVino(host)) {						ircio.privmsg(recipient, "\u0001ACTION giggles at " + nick + "\u0001");						return;					} else if (killerAccess == -1 || killedAccess == -1) {						ircio.privmsg(recipient, "\u0001ACTION laughs, yeah right.\u0001");						return;					} else {						ircio.privmsg(recipient, "It would be my pleasure.");						if (tok.hasMoreElements() && tok.nextToken(" ").equals("from"))							recipient = tok.nextToken("");						ircio.kick(recipient, killed, "You have been bitched by " + name + ". Have a nice day.");						return;					}				} else if (cmd.toLowerCase().equals("tell")) {					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "Tell who what?");						return;					}					String target = tok.nextToken(" ");					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "Tell " + target + " what?");						return;					}					String message = tok.nextToken("");					if (firstMessage == null) {						firstMessage = new Message(target, message, nick);					} else {						currMsg = firstMessage;						while (currMsg.next != null)							currMsg = currMsg.next;						currMsg.next = new Message(target, message, nick);					}					ircio.privmsg(recipient, "OK, I'll make sure to let them know.");				} else if (cmd.toLowerCase().equals("sex") ||						cmd.toLowerCase().equals("secks") ||						cmd.toLowerCase().equals("buttsecks") ||						cmd.toLowerCase().equals("buttsex")) {					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "\u0001ACTION anally rapes " + nick + ".\u0001");						return;					}					String sexed = tok.nextToken(" ");					if (sexed.toLowerCase().equals("vino")) {						ircio.privmsg(recipient, "\u0001ACTION screams as Vino penetrates every orifice of her body!\u0001");					} else {						int sexedAccess = getAccess(sexed, channelNumber(recipient));						if (sexedAccess == -1) {							ircio.privmsg(recipient, "I'd love to, but who the hell is that?");						} else {							ircio.privmsg(recipient, "\u0001ACTION anally rapes " + sexed + ".\u0001");						}					}				} else if (cmd.toLowerCase().equals("reboot")) {					if (isVino(host)) {						ircio.privmsg(recipient, "Be right back.");						System.exit(1);						return;					}				} else if (cmd.toLowerCase().equals("shutdown")) {					if (isVino(host)) {						ircio.privmsg(recipient, "Goodbye everybody!");						System.exit(0);						return;					}				} else if (cmd.toLowerCase().equals("login")) {					if (tok.countTokens() < 1) {						ircio.privmsg(nick, "Yeah. Sure. Whatever.");						return;					}					String passwd = tok.nextToken("");					if (passwd.trim().equals("xxxxx")) {						ircio.privmsg(nick, "Hi, daddy! :D");						vinohost = host;					} else {						ircio.privmsg(nick, "You aint fuckin Vino, prick.");						return;					}				} else if (cmd.toLowerCase().equals("i'm") || 						cmd.toLowerCase().equals("vino's")) {					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "You're what?");						return;					}					if (!isVino(host)) {						ircio.privmsg(recipient, "I don't care.");						return;					}					String location = tok.nextToken("").trim();					if (location.toLowerCase().equals("back")) {						ircio.privmsg(recipient, "Welcome back! You've been away for " + makeTime(vinoleavetime) + ".");						vinoaway = null;					} else {						ircio.privmsg(recipient, "Have fun!");						vinoaway = location;						vinoleavetime = System.currentTimeMillis();					}					return;				} else if (cmd.toLowerCase().equals("say")) {					if (!isVino(host)) {						ircio.privmsg(recipient, "No.");						return;					}					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "Say what?!?");						return;					}					String inchannel = recipient;					if (tok.nextToken().toLowerCase().equals("in")) {						inchannel = tok.nextToken();					}					ircio.privmsg(inchannel, tok.nextToken("").substring(1));					return;				//TODO: Make mode setting colloquial				} else if (cmd.toLowerCase().equals("mode")) {					if (!isVino(host)) {						ircio.privmsg(recipient, "No.");						return;					}					String inchannel = recipient;					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "What channel?");						return;					}					inchannel = tok.nextToken();					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "Who?");						return;					}					String who = tok.nextToken();					String mode;					if (!tok.hasMoreElements()) {						ircio.privmsg(recipient, "What mode?");						return;					} else mode = tok.nextToken();					System.out.println("MODE " + inchannel + " " + mode + " " + who + "\n");					ircio.setMode(who, inchannel, mode);					return;				} else if (msg.toLowerCase().indexOf("excuse") != -1) {					if (System.currentTimeMillis() > nextWho) {	//!spam						String excuse = randomPhrase(new File(sephiadir, "excuses.txt"));						if (excuse != null)							ircio.privmsg(recipient, "Your excuse is: " + excuse);						nextWho = System.currentTimeMillis() + 5000;						return;					}				}			}		} else if (spelledMyNameWrong(botname)) {//			ircio.privmsg(recipient, nick + ", " + spell);		}	}