January 4, 20197 yr Do you need VIP to run local scripts, because my scripts onLoop doesn't seem to execute? I can run the script, and the onStart log outputs, but the onLoop doesn't?
January 4, 20197 yr no you don't need VIP to run local scripts, probably something in the code you wrote Edited January 4, 20197 yr by Spider
January 4, 20197 yr Check the scope of your onloop in the class file or if you're relying on conditional execution that the criteria is being met?
January 4, 20197 yr Author 33 minutes ago, Aftermath said: Check the scope of your onloop in the class file or if you're relying on conditional execution that the criteria is being met? import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "ScriptTest", author = "Jar", version = 1.0, info = "", logo = "") public class ScriptTest extends Script { @Override public void onStart() { log("ScriptTest has started!"); } @Override public void onExit() { log("ScriptTest has ended!"); } @Override public int onLoop() { log("started loop"); return 100; //The amount of time in milliseconds before the loop starts over } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } I wasn't sure if I had to execute onLoop by calling it in onStart, but then every script I've seen doesn't do that, it just simply writes tasks within onLoop & they're executed simultaneously. Edited January 4, 20197 yr by Jar
January 4, 20197 yr 1 hour ago, Jar said: import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "ScriptTest", author = "Jar", version = 1.0, info = "", logo = "") public class ScriptTest extends Script { @Override public void onStart() { log("ScriptTest has started!"); } @Override public void onExit() { log("ScriptTest has ended!"); } @Override public int onLoop() { log("started loop"); return 100; //The amount of time in milliseconds before the loop starts over } @Override public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } I wasn't sure if I had to execute onLoop by calling it in onStart, but then every script I've seen doesn't do that, it just simply writes tasks within onLoop & they're executed simultaneously. You're correct, no need to execute onLoop through onStart, it handles it by itself. Are you sure that you're running the correct output file (not sure if you've maybe made changes)? I've run exactly what you posted and it is logging the loop output. Edited January 4, 20197 yr by Aftermath
January 4, 20197 yr Author 13 minutes ago, Aftermath said: You're correct, no need to execute onLoop through onStart, it handles it by itself. Are you sure that you're running the correct output file (not sure if you've maybe made changes)? I've run exactly what you posted and it is logging the loop output. I forgot to refresh my scripts in the selector ? Thanks for your time & help though :).
Create an account or sign in to comment