All pastes #985449 Raw Edit

Something

public text v1 · immutable
·published 2008-04-15 00:56 UTC
rendered paste body
import org.jibble.pircbot.*;

public class TestBot extends PircBot {
	

	
	// Variable setup
	String prefix = "%";
	String factoids[]; // These lines ...
	factoids = new String[100]; // ... are the only two that seem to cause the problem. That's why I didn't pastebin it in the first place.
	
	// Bot setup
	public TestBot() {
		this.setName("TestBot");
	}
	
	public void onConnect() {
		identify("xxxxxx");	
	}

	public void onMessage(String channel, String sender, String login, String hostname, String message) {
		if (message.startsWith(prefix+"prefix ") && sender.equals("Dr_Link")) {
			String newprefix = message.substring(8).trim();	
			if (newprefix.equals("")) {
				return;
			}		
			if (prefix.length() != 1) {
				sendMessage(channel, "The prefix cannot be changed because prefixes can only be 1 character long.");
			} else {
				prefix = newprefix;
				sendMessage(channel, "The prefix has been changed to " + prefix + ".");
			}
			
		}
		
		if (message.startsWith(prefix+"setfactoid")) {
			String factoidset = message.substring(11).trim();
					
		}

		
	}
}