November 8, 20169 yr Kills lesser demon in mage tower package lesser; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") public class main extends Script { @[member=Override] public void onStart() { //Code here will execute before the loop is started } @[member=Override] public void onExit() { //Code here will execute after the script ends } @[member=Override] public int onLoop() throws InterruptedException { //Script on loop NPC lesser = npcs.closest("Lesser demon"); { if(lesser != null) { if (lesser.isVisible()) { lesser.interact("Attack"); sleep(random(3000, 6000)); } else { camera.toEntity(lesser); } } sleep(random(3000, 6000)); } return 100; //The amount of time in milliseconds before the loop starts over } @[member=Override] public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } }
November 8, 20169 yr he tried True Kills lesser demon in mage tower package lesser; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") public class main extends Script { @[member='Override'] public void onStart() { //Code here will execute before the loop is started } @[member='Override'] public void onExit() { //Code here will execute after the script ends } @[member='Override'] public int onLoop() throws InterruptedException { //Script on loop NPC lesser = npcs.closest("Lesser demon"); { if(lesser != null) { if (lesser.isVisible()) { lesser.interact("Attack"); sleep(random(3000, 6000)); } else { camera.toEntity(lesser); } } sleep(random(3000, 6000)); } return 100; //The amount of time in milliseconds before the loop starts over } @[member='Override'] public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } Try to check if your player is not allready fighting / in combat. Also check if the current health of the demon is > 0 --> meaning the demon isn't death. Otherwise the script will try to attack the demon even though it's doing the death animation.
November 8, 20169 yr Good start mate, now try to slowly add in what everyone is suggesting and you'll be scripting in no time.
November 8, 20169 yr should add a sleep condition to check if you're attacking instead of a sleep(3000,6000); because that will cause it to click every 3-6 seconds Also, i don't think you need to spin the camera to it as the client handles that when you attack it Overall not a bad start
November 8, 20169 yr Kills lesser demon in mage tower package lesser; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(name = "lesser demon", author = "combat", version = 1.0, info = "", logo = "") public class main extends Script { @[member='Override'] public void onStart() { //Code here will execute before the loop is started } @[member='Override'] public void onExit() { //Code here will execute after the script ends } @[member='Override'] public int onLoop() throws InterruptedException { //Script on loop NPC lesser = npcs.closest("Lesser demon"); { if(lesser != null) { if (lesser.isVisible()) { lesser.interact("Attack"); sleep(random(3000, 6000)); } else { camera.toEntity(lesser); } } sleep(random(3000, 6000)); } return 100; //The amount of time in milliseconds before the loop starts over } @[member='Override'] public void onPaint(Graphics2D g) { //This is where you will put your code for paint(s) } } omfg was looking for exactly this, can you make it into a .jar? should add a sleep condition to check if you're attacking instead of a sleep(3000,6000); because that will cause it to click every 3-6 seconds Also, i don't think you need to spin the camera to it as the client handles that when you attack it Overall not a bad start how come the AIO fighter cant attack NPCs behind bars?
November 8, 20169 yr omfg was looking for exactly this, can you make it into a .jar? how come the AIO fighter cant attack NPCs behind bars? Because there's only like 3 monsters like that in the game and didn't custom code that.
November 8, 20169 yr Because there's only like 3 monsters like that in the game and didn't custom code that. but but why cant it just click on the NPC?
Create an account or sign in to comment