Jump to content

getting current world


Reid

Recommended Posts

public static final int getCurrentWorld(final ClassLoader loader)
   throws Exception {
  final Field field = loader.loadClass("client").getDeclaredField("z");
  if (!field.isAccessible())
   field.setAccessible(true);
  return field.getInt(null) * -2588411;
 }


Usage: getCurrentWorld(bot.D());

currently using this to check if im in world 85 then i hop if i am

Link to comment
Share on other sites

wat no dog_ wrote it

that's me

You could just make your own small updater and implement it into your script. Grabbing them fields is pretty easy as the class "client" has a fixed name and doesn't change throughout revisions; you'd just have to hunt a pattern down with either ASM or regex =) I've done it before so it can't be that hard haha

I have my own updater but it's really a waste of time implementing it into a script lol
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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