import org.uwcs.choob.*;
import org.uwcs.choob.modules.*;
import org.uwcs.choob.support.*;
import org.uwcs.choob.support.events.*;

class Plugin
{
	public void commandLoadPlugin( Message con, Modules modules, IRCInterface irc )
	{
		List parms = modules.util.getParams( con );

		if( parms.size() < 3 )
		{
			irc.sendContextReply(con, "Incorrect syntax! Dyooooooh!");
			return;
		}

		if ( parms.get(1).indexOf("/") != -1 )
		{
			irc.sendContextReply(con, "Arguments the other way around, you spoon.");
			return;
		}

		irc.sendContextReply(con, "Loading plugin.. " + parms.get(1));
		try
		{
			modules.plugin.addPlugin(parms.get(2), parms.get(1));
			irc.sendContextReply(con, "Plugin parsed, compiled and loaded!");
		}
		catch (Exception e)
		{
			irc.sendContextReply(con, "Error parsing plugin, see log for details.");
			e.printStackTrace();
		}
	}

	public void commandReloadPluginPermissions( Message mes, Modules modules, IRCInterface irc )
	{
		List parms = modules.util.getParams( mes );
		if (parms.size() != 2)
		{
			irc.sendContextReply(mes, "You must specify a plugin name and only that.");
			return;
		}
		modules.plugin.reloadPluginPermissions((String) parms.get(1));
		irc.sendContextReply(mes, "OK, permissions reloaded for " + parms.get(1) + ".");
	}
}

@@ -123,16 +123,42 @@
 vents.*;
+%0Aimport java.util.regex.*;
 %0A%0Aclass 
@@ -252,32 +252,33 @@
  )%0A%09%7B%0A%09%09List par
+a
 ms = modules.uti
@@ -304,15 +304,57 @@
 %0A%0A%09%09
-if( 
+String url=%22%22;%0A%09%09String classname=%22%22;%0A%0A%09%09if (
 par
+a
 ms.s
@@ -363,80 +363,408 @@
 e() 
-%3C 3 
+== 2)%0A%09%09%7B%0A%09%09%09Pattern pa;%0A%09%09%09Matcher ma;%0A%09%09%09url=params.get(1);%0A%09%09%09pa = Pattern.compile(%22%5E.*%5C%5C/(%5B%5E%5C%5C/%5D+)%5C%5C.java$%22);%0A%09%09%09ma = pa.matcher(url);%0A%09%09%09if (ma.matches()
 )%0A%09%09
+%09
-%7B%0A%09%09%09irc.sendContextReply(con, %22Incorrect syntax! Dyooooooh!
+%09classname=ma.group(1);%0A%09%09%09else%0A%09%09%09%09irc.sendContextReply(con, %22Unable to parse url (%22 + url + %22) -%3E classname, please specify.%22);%0A%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09if( params.size() != 3 )%0A%09%09%09%7B%0A%09%09%09%09irc.sendContextReply(con, %22Syntax: %5Bclassname%5D url
 %22);%0A
+%09
 %09%09%09r
@@ -776,21 +776,65 @@
 ;%0A%09%09
+%09
 %7D%0A
-%0A%09%09if ( 
+%09%09%09else%0A%09%09%09%7B%0A%09%09%09%09url=params.get(2);%0A%09%09%09%09classname=
 par
+a
 ms.g
@@ -838,16 +838,36 @@
 s.get(1)
+;%0A%09%09%09%09if ( classname
 .indexOf
@@ -878,26 +878,30 @@
 ) != -1 )%0A%09%09
-%7B%0A
+%09%09%7B%0A%09%09
 %09%09%09irc.sendC
@@ -963,32 +963,34 @@
 poon.%22);%0A%09%09%09
+%09%09
 return;%0A
 %09%09%7D%0A%0A%09%09irc.s
@@ -981,13 +981,26 @@
 rn;%0A
+%09%09
 %09%09%7D%0A%0A
+%09%09%09%7D%0A%09%09%7D%0A%0A%0A
 %09%09ir
@@ -1045,31 +1045,29 @@
 n.. %22 + 
-parms.get(1)
+classname
 );%0A
+%0A
 %09%09try%0A%09%09
@@ -1100,34 +1100,22 @@
 gin(
-parms.get(2), parms.get(1)
+url, classname
 );%0A%09
@@ -1427,16 +1427,17 @@
 List par
+a
 ms = mod
@@ -1473,16 +1473,17 @@
 %09if (par
+a
 ms.size(
@@ -1637,24 +1637,25 @@
 (String) par
+a
 ms.get(1));%0A
@@ -1719,16 +1719,17 @@
  %22 + par
+a
 ms.get(1

Remove surplus argument from Plugin.LoadPlugin