I have my subclass:
public class Actions extends Main{ public void getFireTarget() { GameObject target = getGameObjects().closest("Target"); do{ log("Shooting at the target"); getMouse().click(target); } while(target != null && !getDialogues().inDialogue() && getLocalPlayer().getTile().equals(rangeTile)); } }
I want to write similar methods, so I can call them in my Main class, so I don't have to write over and over.
My main class looks like this (won't fully paste it as it's long):
public class Main extends AbstractScript{ ...code here Actions actions = new Actions(); }
So I am trying to implement the methods in Actions by doing actions.getFireTarget(), which seems to work. But when I compile, I am getting two compile errors: 1) In the Main class, in the line: Actions actions = new Actions(); 2) In the Actions class, in the line where I am extending the superclass.
Am I missing something in the sub class in order to store methods and then call them in the main method? Please advise! Thanks