combat_acc Posted November 8, 2016 Share Posted November 8, 2016 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) } } 2 Quote Link to comment Share on other sites More sharing options...
Sysm Posted November 8, 2016 Share Posted November 8, 2016 Nice, its wizard's tower btw lul Cx Quote Link to comment Share on other sites More sharing options...
Spookz Posted November 8, 2016 Share Posted November 8, 2016 didn't make it downloadable for us code inept fucks 3 Quote Link to comment Share on other sites More sharing options...
lepurc Posted November 8, 2016 Share Posted November 8, 2016 There's a lesser demon. Never even realised lol but gz Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted November 8, 2016 Share Posted November 8, 2016 This will keep attacking the demon every 3 - 6 sec 2 Quote Link to comment Share on other sites More sharing options...
combat_acc Posted November 8, 2016 Author Share Posted November 8, 2016 This will keep attacking the demon every 3 - 6 sec yes Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted November 8, 2016 Share Posted November 8, 2016 yes Even if you are allready attacking it Quote Link to comment Share on other sites More sharing options...
Muffins Posted November 8, 2016 Share Posted November 8, 2016 Even if you are allready attacking it he tried 1 Quote Link to comment Share on other sites More sharing options...
Eagle Scripts Posted November 8, 2016 Share Posted November 8, 2016 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. 1 Quote Link to comment Share on other sites More sharing options...
Huz Posted November 8, 2016 Share Posted November 8, 2016 Nice, its wizard's tower btw lul CxIsn't the apostrophe after the s? hehe xd Quote Link to comment Share on other sites More sharing options...
dontbuzz Posted November 8, 2016 Share Posted November 8, 2016 Good start mate, now try to slowly add in what everyone is suggesting and you'll be scripting in no time. Quote Link to comment Share on other sites More sharing options...
Juggles Posted November 8, 2016 Share Posted November 8, 2016 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 Quote Link to comment Share on other sites More sharing options...
gearing Posted November 8, 2016 Share Posted November 8, 2016 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? Quote Link to comment Share on other sites More sharing options...
Juggles Posted November 8, 2016 Share Posted November 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
gearing Posted November 8, 2016 Share Posted November 8, 2016 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? Quote Link to comment Share on other sites More sharing options...