Jump to content

overide pause on logout.


YinZ

Recommended Posts

import org.osbot.rs07.api.WorldHopper;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.script.Script;

import java.lang.reflect.Field;

/**
 * Created with IntelliJ IDEA
 * User: Anthony
 * Date: 6/8/2014
 */

public class ModifiedWorldHopper extends WorldHopper {

	private Script sI;

	public ModifiedWorldHopper(Script sI) {
		this.sI = sI;
	}

	public void setModifiedWorldHopper() throws IllegalAccessException {
		for (Field f : MethodProvider.class.getDeclaredFields()) {
			if (f.getType() == WorldHopper.class) {
				f.setAccessible(true);
				f.set(instance of method provider, this);
			}
		}
	}

	@Override
	public void hop(int world) {
		//your world hopping code
	}

}

Not sure how to get an instance of the MethodProvider class, but if you are able to this should work with setting your own instance.

  • Like 1
Link to comment
Share on other sites

import org.osbot.rs07.api.WorldHopper;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.script.Script;

import java.lang.reflect.Field;

/**
 * Created with IntelliJ IDEA
 * User: Anthony
 * Date: 6/8/2014
 */

public class ModifiedWorldHopper extends WorldHopper {

	private Script sI;

	public ModifiedWorldHopper(Script sI) {
		this.sI = sI;
	}

	public void setModifiedWorldHopper() throws IllegalAccessException {
		for (Field f : MethodProvider.class.getDeclaredFields()) {
			if (f.getType() == WorldHopper.class) {
				f.setAccessible(true);
				f.set(instance of method provider, this);
			}
		}
	}

	@Override
	public void hop(int world) {
		//your world hopping code
	}

}

Not sure how to get an instance of the MethodProvider class, but if you are able to this should work with setting your own instance.

 

 

Thanks, Ill see what i can come up with!

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...