Joseph Posted July 26, 2014 Posted July 26, 2014 (edited) public boolean enableRun(boolean on) { if (!script.settings.isDataOrbsActive()) return script.settings.setRunning(on); else{ if (script.interfaces.getChild(548, 93) != null) return script.interfaces.getChild(548, 93).interact(); else return false; } } Its nothing much to it, support both the orbs or using settings. edit: i updated op to support enabling method Edited July 26, 2014 by josedpay
Joseph Posted July 26, 2014 Author Posted July 26, 2014 (edited) I actually plan on updating the run method soon. That's nice to know , i was just organizing my dependencies folder, i saw this method, decide why not release it. Also i have a question for you, ill pm it to you now Edited July 26, 2014 by josedpay
Pseudo Posted July 26, 2014 Posted July 26, 2014 (edited) public boolean turnRunOn() { return !script.settings.isDataOrbsActive() && (script.interfaces.getChild(548, 93) != null ? script.interfaces.getChild(548, 93).interact(): script.settings.setRunning(true)); } Edited July 26, 2014 by Pseudo
Joseph Posted July 26, 2014 Author Posted July 26, 2014 public boolean turnRunOn() { return !script.settings.isDataOrbsActive() && (script.interfaces.getChild(548, 93) != null ? script.interfaces.getChild(548, 93).interact(): script.settings.setRunning(true)); } pointless post
Pseudo Posted July 26, 2014 Posted July 26, 2014 pointless post How is posting code improvements 'pointless'?
Joseph Posted July 26, 2014 Author Posted July 26, 2014 How is posting code improvements 'pointless'? wtf, the only thing you changed was making it into one line -.-, I want my code to be readable. For those new scripters. Also, your code will never return true if someone has the data orbs on because of return !script.settings.isDataOrbsActive() && (blah); so if this is improving code, i dont know what java is
Swizzbeat Posted July 26, 2014 Posted July 26, 2014 (edited) It's kinda redundant adding a null check for the 548 widget, since it's what makes up the main game screen. Have it take a boolean for enable/disable run and rename it to enableRun or something to make the method more versatile. public boolean turnRunOn() { return !script.settings.isDataOrbsActive() && (script.interfaces.getChild(548, 93) != null ? script.interfaces.getChild(548, 93).interact(): script.settings.setRunning(true)); } Should be: public boolean turnRunOn() { return script.configs.get(RUN_CONFIG) > 0 || (!script.settings.isDataOrbsActive() && script.settings.setRunning(true)) || script.interfaces.getChild(548, 93).interact(); } Edited July 26, 2014 by Swizzbeat
Joseph Posted July 26, 2014 Author Posted July 26, 2014 It's kinda redundant adding a null check for the 548 widget, since it's what makes up the main game screen. Have it take a boolean for enable/disable run and rename it to enableRun or something to make the method more versatile. i was checking the widgets child to see if it contains the the orb to interact with it. Since the api doesnt contain a method. Also i only supplying the basic, the get run energy and stuff they could add it in there self. edit op too
Swizzbeat Posted July 26, 2014 Posted July 26, 2014 i was checking the widgets child to see if it contains the the orb to interact with it. Since the api doesnt contain a method. Also i only supplying the basic, the get run energy and stuff they could add it in there self. edit op too I'm 99% sure the widget child is always there, despite whether orbs are enabled or not. Just a suggestion :p
Pseudo Posted July 27, 2014 Posted July 27, 2014 It's kinda redundant adding a null check for the 548 widget, since it's what makes up the main game screen. Have it take a boolean for enable/disable run and rename it to enableRun or something to make the method more versatile. Should be: public boolean turnRunOn() { return script.configs.get(RUN_CONFIG) > 0 || (!script.settings.isDataOrbsActive() && script.settings.setRunning(true)) || script.interfaces.getChild(548, 93).interact(); } I don't even Osbot, . Just posting dat ternary. 1