Chris Posted August 29, 2015 Share Posted August 29, 2015 How would I effectively initialize a fighting class? My execute() is okay Just my validate() is always returning true and takes a chunk out of my CPU : ~35%+ ( in my fighting node) All my other node calls are fine and use low amounts! : ~8% altogether I only want it to call the Fighting node when NPC is onscreen and Loot is not on the ground. I have tried workarounds to what I can understand from looking through the API but you big scripters can help OSBOTS #1 NOOB SCRIPTER? Example of what I am using: @Override public boolean shouldDoActivity(Script s) { return (Constants.areaDragons.contains(s.myPlayer()) && s.groundItems.closest(Constants.areaDragons,Constants.loot) == null && !s.myPlayer().isAnimating() && !s.myPlayer().isUnderAttack()); //This is where it willl validate if its truel... Execute... etc. } Help me babes Quote Link to comment Share on other sites More sharing options...
towelman Posted August 29, 2015 Share Posted August 29, 2015 1 Quote Link to comment Share on other sites More sharing options...
Botre Posted August 29, 2015 Share Posted August 29, 2015 Hard to tell without seeing the architecture behind it all. Might be this though: s.groundItems.closest(Constants.areaDragons,Constants.loot) == null Try and remove that and see how it affects your CPU ^^ 2 Quote Link to comment Share on other sites More sharing options...
Chris Posted August 29, 2015 Author Share Posted August 29, 2015 (edited) Hard to tell without seeing the architecture behind it all. Might be this though: s.groundItems.closest(Constants.areaDragons,Constants.loot) == null Try and remove that and see how it affects your CPU ^^ This is my fight class: public class Fighting implements Activity { @Override public boolean shouldDoActivity(Script s) { return (); //Code being validated } //attack anim =390 || 829 for eating @Override public int doActivity(Script s) throws InterruptedException { //....Code being executed } return 0; } And I will try that Edited August 29, 2015 by Sinatra Quote Link to comment Share on other sites More sharing options...