Parameter Posted January 12, 2014 Posted January 12, 2014 (edited) public static String getSelectedItem(final ClassLoader loader) throws Exception { final Field field = loader.loadClass("client").getDeclaredField("ia"); field.setAccessible(true); return (String) field.get(null); } public static int getSelectionState(final ClassLoader loader) throws Exception { final Field field = loader.loadClass("client").getDeclaredField("ib"); field.setAccessible(true); return field.getInt(null) * 1348970433; } public static boolean isSelected(final ClassLoader loader) throws Exception { return getSelectionState(loader) != 0; } How to use these? Let's say we want to do this in the onLoop method: public int onLoop() throws InterruptedException { final ClassLoader loader = bot.I() //Change bot.I() to whatever method returns a classloader at the moment if(isSelected(loader)) { final String selected = getSelectedItem(loader); } return 50; } Edited January 13, 2014 by Parameter 1
Parameter Posted January 12, 2014 Author Posted January 12, 2014 Nice! How you get the declared fields? Searching through the client
Omoshu Posted January 12, 2014 Posted January 12, 2014 Why aren't these methods accessible through the standard API?
While Posted January 13, 2014 Posted January 13, 2014 Why aren't these methods accessible through the standard API? The developers haven't hooked them.