Jump to content

Need some help.


Recommended Posts

Posted (edited)

I'm trying to call a function in the main class from another class called CookFood, but it doesn't want to work.

Everything inside the CookFood class works fine, like getting the food name and the actual cooking.

 

CookFood:

package reflexd;

import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.MethodProvider;
import reflexd.Main;

public class CookFood {
	
	private Main main = new Main();
	private String foodName = main.getFoodName(); // works
	
	public CookFood(Script s) throws InterruptedException {
	    main.changeStatus("Moving camera"); // doesn't work
	}

} 

The function in Main that I'm trying to access:

public void changeStatus(String status) {
    scriptStatus = status;
}

How I'm initializing CookFood:

case COOK:
    new CookFood(this);
break;

It doesn't spit out any errors or anything at all in the logger, don't really know what to do.

Any help is greatly appreciated. smile.png

Edited by Reflexd

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