The class is named InventoryTrackers (with an s), the interface name is InventoryTracker (without the s, found statically in the class.)
How do you use it, you must create a new thread and initialize it. You must also end the thread once the script is done. Dont for get to implement InventoryTracker.
Example:
public class ScriptName extends Script implements InventoryTracker {
private InventoryTrackers invTracker; //create a field
}
Next create a new thread, and initialize the tracker within the onStart
Override
public void onStart() throws InterruptedException {
this.invTracker = new InventoryTrackers(this, this);
new Thread(invTracker).start();
}
Now within your script you should have the two method overrided. Keep the condition so it doesn't affect your script once its paused or not logged in.
@Override
public void handleAdded(Item item) {
if (!bot.getScriptExecutor().isPaused() && client.isLoggedIn()) { }
}
@Override
public void handleRemoved(Item item) {
if (!bot.getScriptExecutor().isPaused() && client.isLoggedIn()) { }
}
Kill the thread once the script is over.
@Override
public void onExit() throws InterruptedException { invTracker.stop(); }
if you have any question feel free to ask. if im missing something let me know.