Here's the new script skeleton you will be using, please import the class files down below as these are not in the OsBot API.
In the scriptStart method, add your class, or classes that extend my custom Node class. (Example shown below)
package ca.midnightblue.scripts.wc;
import java.awt.Graphics2D;
import org.osbot.rs07.script.ScriptManifest;
import ca.midnightblue.scripts.wc.nodes.Idling;
@ScriptManifest(name = "Custom Script Skeleton", author = "Midnight Blue", version = 1.0, info = "", logo = "")
public class Core extends CustomScript {
@Override
public void scriptStart() {
add(Woodcut.class, Walk.class, Bank.class);
}
@Override
public void scriptStop() {
}
@Override
public void loop() {
}
@Override
public void paint(Graphics2D g) {
}
}
Now in your classes that extend Node, which will contain the back bone aka the script functionality, the function "loop" that returns an integer is where you want to put what the bot does during that loop, you will return the amount of time you want the bot to sleep, by default it sleeps a random interval of 10 to 100MS. Your validate method will return when you want this script to activate. (You don't want to run all of your scripts at the same time) And lastly, your getStatus method should return a string with a brief description of what the bot is doing at the moment. Example: If your bot is banking return "banking".
Here's an example of how to use my new script skeleton
package ca.midnightblue.scripts.wc.nodes;
import org.osbot.rs07.script.Script;
public class Idling extends Node {
private long then;
public Idling(Script script) {
super(script);
then = System.currentTimeMillis();
}
@Override
public int loop() {
long now = System.currentTimeMillis();
if(now - then <= 300000L) { //every 5 minutes
then = now;
//open tabs or something
}
return 0;
}
@Override
public boolean validate() {
return !script.myPlayer().isMoving();
}
@Override
public String getStatus() {
return "Idling";
}
}
Node.java
CustomScript.java
Hope you enjoy! :-) Please comment if you like this noob-friendly node snippet I made!