Kierze21 0 Posted May 30, 2016 So i just made my first ever script package CowKiller; import org.dreambot.api.methods.Calculations; import org.dreambot.api.script.AbstractScript; import org.dreambot.api.script.Category; import org.dreambot.api.script.ScriptManifest; import org.dreambot.api.wrappers.interactive.GameObject; @ScriptManifest(category = Category.COMBAT, name = "Cow Kiler", author = "Kierze", version = 1.0) public class MainClass extends AbstractScript { public boolean inCombat = false; @Override public int onLoop() { if(getLocalPlayer().isInCombat()) { inCombat = true; } GameObject cow = getGameObjects().closest(gameObject -> gameObject != null && gameObject.getName().equals("Cow") && gameObject.hasAction("Attack")); if(!inCombat) { cow.interact("Attack"); sleepUntil(() -> getLocalPlayer().isInCombat(), Calculations.random(5000, 7000)); } return 600; } public void OnStart() { log("Started"); } public void OnExit() { } } and i was wondering on how to actually test it From my own knowledge/testing i guess you export as a .Jar then put it in "Scripts" folder inside the dreambot folder, however when i try to export as jar it says
Harold 11 Posted May 30, 2016 This is because I believe you're trying to export it as a standalone jar file (without a main(String[] args) method in your main class). You should export your script using the IntelliJ artifacts window, see https://www.jetbrains.com/help/idea/2016.1/c for more info.
Cardozz 46 Posted May 30, 2016 A normal Java program requires the main method to be called main (no exceptions). DreamBot uses just jar files, so there is indeed a chance that you are actually exporting the jar file as a runable jar file, which requires a main method.
Kierze21 0 Author Posted May 30, 2016 This is because I believe you're trying to export it as a standalone jar file (without a main(String[] args) method in your main class). You should export your script using the IntelliJ artifacts window, see https://www.jetbrains.com/help/idea/2016.1/c for more info. this was the issue, thanks for helping
Explicit 213 Posted May 31, 2016 This is because I believe you're trying to export it as a standalone jar file (without a main(String[] args) method in your main class). You should export your script using the IntelliJ artifacts window, see https://www.jetbrains.com/help/idea/2016.1/c for more info. omg you're not dead
Recommended Posts
Archived
This topic is now archived and is closed to further replies.