Jump to content

Some inventory methods


Parameter
 Share

Recommended Posts



 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 by Parameter
  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...