combat_acc Posted November 8, 2016 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
Spookz Posted November 8, 2016 Posted November 8, 2016 didn't make it downloadable for us code inept fucks 3
lepurc Posted November 8, 2016 Posted November 8, 2016 There's a lesser demon. Never even realised lol but gz
Eagle Scripts Posted November 8, 2016 Posted November 8, 2016 This will keep attacking the demon every 3 - 6 sec 2
combat_acc Posted November 8, 2016 Author Posted November 8, 2016 This will keep attacking the demon every 3 - 6 sec yes
Eagle Scripts Posted November 8, 2016 Posted November 8, 2016 yes Even if you are allready attacking it
Muffins Posted November 8, 2016 Posted November 8, 2016 Even if you are allready attacking it he tried 1
Eagle Scripts Posted November 8, 2016 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
Huz Posted November 8, 2016 Posted November 8, 2016 Nice, its wizard's tower btw lul CxIsn't the apostrophe after the s? hehe xd
dontbuzz Posted November 8, 2016 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.
Juggles Posted November 8, 2016 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
gearing Posted November 8, 2016 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?
Juggles Posted November 8, 2016 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.
gearing Posted November 8, 2016 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?