All pastes #611991 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-10 04:09 UTC
rendered paste body
import org.jibble.pircbot.*;import java.util.*;import java.net.*;import java.io.*;

public class iKitty extends PircBot {

	Timer unbanTimer;

		public iKitty() {
	        	this.setName("iKitty");
	        	sendMessage("nickserv", "identify Kitty_Cat");
				timeUnbanTask unban = new timeUnbanTask("unBan(channel, hostmask)");
		}
	        
		public void onDisconnect() {
			try {
				reconnect();
			}
			catch (IOException e) {
			}
			catch (IrcException e) {
			}
		}

		public void onQuit(String sourceNick, String sourceLogin, String sourceHostname, String reason) {
			if (sourceNick.equalsIgnoreCase("iKitty")) {
				this.setName("iKitty");
				sendMessage("nickserv", "identify Kitty_Cat");
			}
		}

		public void onJoin(String channel, String sender, String login, String hostname) {
			if (sender.equalsIgnoreCase(getNick())) {
				setMode(getNick(), "+T");
				setMode(getNick(), "+p");
				setMode(getNick(), "+B");
			}
		}


		public void onMessage(String channel, String sender, String login, String hostname, String message, String hostmask) {
			if (message.startsWith("Playing: [")) {
				if (message.endsWith(".mp3 ]")) {
					ban(channel, hostmask);
					kick(channel, sender, "The mp3 script isn't welcome.  Turn it off.  Your ban will be removed in 1 minute");
					unbanTimer = new Timer();
					unbanTimer.schedule(unban, 60 * 1000, 0);
				}
			}
		}
	    class timeUnbanTask extends TimerTask {
	        private String task();
	        public TimerTask(String task) {

	        }
	        
	        public void run() {

	        	
	        }
	    }
	
}