Why are there so many errors on this code?

101 Views Asked by At
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.powerbot.core.script.job.Task;
import org.powerbot.core.script.job.state.Node;
import org.powerbot.core.script.job.state.Tree;
import org.powerbot.game.api.util.Timer;

public abstract class ScriptWrapper extends org.powerbot.core.script.ActiveScript {

    public final Timer runTime;
    private Tree jobContainer = null;
    private List<Node> jobs;


    public ScriptWrapper() {
        runTime = new Timer(0);
        jobs = Collections.synchronizedList(new ArrayList<Node>());
    }

    public final void provide(final Node job) {
        if(!jobs.contains(job)) {
            jobs.add(job);
            jobContainer = new Tree(jobs.toArray(new Node[jobs.size()]));
        }
    }

    public final void revoke(final Node job) {
        if(jobs.contains(job)) {
            jobs.remove(job);
            jobContainer = new Tree(jobs.toArray(new Node[jobs.size()]));
        }
    }

    public final void submit(final Task task) {
        getContainer().submit(task);
    }

    public final ScriptWrapper getScriptWrapper() {
        return this;
    }

    public abstract void onStart();

    @Override
    public int loop(); {
        if (jobContainer != null) {
            final Node job = jobContainer.state();
            if (job != null) {
                jobContainer.set(job);
                getContainer().submit(job);
                job.join();
            }
        }
        return 0;
    }
}

There are so many errors in this code and I don't know how fix this because I am a beginner, and when I do fix one ten more pop up, such as when I fixed a parsing error 23 errors came in. I've only had 15 coding classes.

1

There are 1 best solutions below

3
On

You must add the ActiveScript library to you code, and then the errors will be fixed :)