import impsoft.ibot.methods.Script; import java.awt.event.MouseListener; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URL; import java.security.CodeSource; public class unitTest2 extends Script { public static double version = 2.1; public static String[] commands = new String[] { "mouselistener", }; public String author = "ruler"; public String description = "a simple demo"; public static String args[]; @Override public boolean doStart(String cmd, String[] args) { return true; } @Override public void script() throws InterruptedException { while (true) { MouseListener mouseListener = theBot.theApplet.getComponentAt(1, 1) .getListeners(MouseListener.class)[0]; // hehe mouseListener.mouseClicked(e); log("IBOT runescape static listener"); printClass("", mouseListener); log("IBOT runescape applet"); printClass("", theBot.theApplet); sleep(1000); } } public void printClass(String front, Object test) { Class theClass = test.getClass(); CodeSource source = theClass.getProtectionDomain().getCodeSource(); if (source != null) { front += theClass.getName() + "."; URL location = source.getLocation(); log(theClass.getPackage() + " : " + location); String classDeclaration = getModifiers(theClass) + theClass.getName(); if (theClass.getSuperclass() != null) { classDeclaration += " extends " + theClass.getSuperclass().getName(); } Class interfaces[] = theClass.getInterfaces(); for(int i=0;i 0) { printOut += "[]"; depth--; } //log(getModifiers(fields[i]) + componentName + printOut // + " " + front + fields[i].getName() + " = " //+ value(front, fields[i], theClass)); String front2 = getModifiers(fields[i]) + " " + componentName + printOut + " " + front + fields[i].getName(); valueArray(front2, fields[i], theClass); } else { // log(" " + getModifiers(fields[i]) + typeClass.getName() // + " " + fields[i].getName() + " " // + value(fields[i], theClass)); String value = value(front, fields[i], theClass, test); if (value.length() > 1) { log(getModifiers(fields[i]) + " " + typeClass.getName() + " " + front + fields[i].getName() + " = " + value); } } fields[i].setAccessible(false); } Method methods[] = theClass.getDeclaredMethods(); for(int i=0;i