Jump to content

Interact() Method Not Working?


Recommended Posts

Posted

Hey,

 

So I made a script and it worked perfectly until OSBot updated to 2.3.66. What my script did is that it used to pick up things and bank. Now, where it should pick up, instead, the mouse hovers over the item and moves away and does not click. Even my localWalker does not work anymore.

 

I made the below sample script to see if was just a problem with my individual bot script:

package Test;

import org.osbot.rs07.api.LocalWalker;
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.Message;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.Area;

import java.awt.*;

@ScriptManifest(author = "Doomdude70", info = "Picks wheat", name = "Test", version = 1.0, logo = "")
public class NPCs extends Script {


	@Override
	public void onStart() {
		log("Start");
	}

	private enum State {
		PICKWHEAT;
	}
	
	private State getState() {
		return State.PICKWHEAT;
	}
	

	@Override
	public int onLoop() throws InterruptedException {
		switch (getState()) {
		case PICKWHEAT:
			RS2Object wheat = objects.closest("Wheat");
			wheat.interact("Pick");
		break;
		}
		

		return random(200, 300);
	}

	@Override
	public void onExit() {
		log("Exit");
	}

	@Override
	public void onPaint(Graphics2D g) {

	}

}

This sample script did not work either. The mouse hovered over the wheat and quickly moved away again without clicking.

 

So, what's the deal? What should I do? tongue.png

Posted

i believe there was something wrong with 2.3.66.

 

I suggest you re-install osbot.

 

Thanks xD I should have tried that earlier, I reinstalled OSBot and it started working perfectly again.

 

On the website when you go to download it says OSBot version is 2.33.65. Seems like there IS some sort of problem with 2.33.66.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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