roguehippo Posted December 20, 2016 Share Posted December 20, 2016 I was just wondering what would be the easiest way to 1. Check if i am autocasting a spell or what i am autocasting. and 2. how to select a spell to autocast. I couldnt really find any premade functions that dealt with the Combat tab in the magic interface. 1 Quote Link to comment Share on other sites More sharing options...
Chris Posted December 20, 2016 Share Posted December 20, 2016 Try autocast api made by botre in the snippets section Quote Link to comment Share on other sites More sharing options...
XmQ Posted December 20, 2016 Share Posted December 20, 2016 Check config to check if auto-cast is set. Anyways.. I think configs work with autocast Quote Link to comment Share on other sites More sharing options...
Abuse Posted December 20, 2016 Share Posted December 20, 2016 (edited) Autocast config is getConfigs().get(108) Not sure if the 108 is related to what staff you are carrying or it's just static, I've done this with a staff of air Value 0 is no spell selected Value 3 is air strike 5 is water strike and so on Here is a snippet that does a spell change based on levels private int getSpellChange() { int currentSpell = self.getConfigs().get(108); int currentLevel = self.getSkills().getStatic(Skill.MAGIC); if (currentLevel >= 13) { if (currentSpell != 9) { return 4; } else{ return 0; } } else if (currentLevel >= 9) { if (currentSpell != 7) { return 3; } else{ return 0; } } else if (currentLevel >= 5) { if (currentSpell != 5) { return 2; } else{ return 0; } } else if (currentLevel >= 1) { if (currentSpell != 3) { return 1; } else{ return 0; } } return 0; } private void changeSpell() { if (self.getTabs().open(Tab.ATTACK)) { RS2Widget castWidget = self.getWidgets().get(593, 25); if (castWidget != null && castWidget.isVisible()) { if (castWidget.interact()) { new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) { @[member=Override] public boolean condition() throws InterruptedException { return !castWidget.isVisible(); } }.sleep(); } } else { RS2Widget spellWidget = self.getWidgets().get(201, 0 , getSpellChange()); if (spellWidget != null && spellWidget.isVisible() && spellWidget.interact()) { new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) { @[member=Override] public boolean condition() throws InterruptedException { return getSpellChange() == 0; } }.sleep(); if (MethodProvider.random(0, 1) == 0) { self.getTabs().open(Tab.INVENTORY); } } } } } Edited December 20, 2016 by Abuse 1 Quote Link to comment Share on other sites More sharing options...
roguehippo Posted December 30, 2016 Author Share Posted December 30, 2016 Autocast config is getConfigs().get(108) Not sure if the 108 is related to what staff you are carrying or it's just static, I've done this with a staff of air Value 0 is no spell selected Value 3 is air strike 5 is water strike and so on Here is a snippet that does a spell change based on levels private int getSpellChange() { int currentSpell = self.getConfigs().get(108); int currentLevel = self.getSkills().getStatic(Skill.MAGIC); if (currentLevel >= 13) { if (currentSpell != 9) { return 4; } else{ return 0; } } else if (currentLevel >= 9) { if (currentSpell != 7) { return 3; } else{ return 0; } } else if (currentLevel >= 5) { if (currentSpell != 5) { return 2; } else{ return 0; } } else if (currentLevel >= 1) { if (currentSpell != 3) { return 1; } else{ return 0; } } return 0; } private void changeSpell() { if (self.getTabs().open(Tab.ATTACK)) { RS2Widget castWidget = self.getWidgets().get(593, 25); if (castWidget != null && castWidget.isVisible()) { if (castWidget.interact()) { new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) { @[member='Override'] public boolean condition() throws InterruptedException { return !castWidget.isVisible(); } }.sleep(); } } else { RS2Widget spellWidget = self.getWidgets().get(201, 0 , getSpellChange()); if (spellWidget != null && spellWidget.isVisible() && spellWidget.interact()) { new ConditionalSleep(MethodProvider.random(2000,5000), MethodProvider.random(100,200)) { @[member='Override'] public boolean condition() throws InterruptedException { return getSpellChange() == 0; } }.sleep(); if (MethodProvider.random(0, 1) == 0) { self.getTabs().open(Tab.INVENTORY); } } } } } sorry for the late reply but thanks so much! this will definitely come in handy. Try autocast api made by botre in the snippets section i saw that but i dont really know how to add like a function like that into my script Quote Link to comment Share on other sites More sharing options...