daggerattacker81 Posted September 19, 2015 Share Posted September 19, 2015 I'm trying to get setRunning to work. I've set up the method to return true and I'm passing it a false parameter. public boolean setRunning(boolean run) { return true; } public psuedoLoop() { setRunning(false); } I'm sure I'm doing something wrong. I'm trying to set run off and I've tried all combinations of true and false returns and parameters. Quote Link to comment Share on other sites More sharing options...
fixthissite Posted September 19, 2015 Share Posted September 19, 2015 What are you trying to do? Right now, you aren't actually setting anything. Although you pass the method "false", you do not do anything with the value inside of the setRunning method. Do you have a "running" field variable that you want to adjust through the setRunning method? 1 Quote Link to comment Share on other sites More sharing options...
daggerattacker81 Posted September 19, 2015 Author Share Posted September 19, 2015 I want to set running on while my bot loots items and set it off during trips to and from the bank. I'm still unfamiliar with a lot of the OSBot API so I have no clue what to do with the setRunning method.Is there any way to directly manipulate isRunning or is setRunning the only way to go about toggling run on/off? Quote Link to comment Share on other sites More sharing options...
Alek Posted September 19, 2015 Share Posted September 19, 2015 This really has nothing to do with the OSBot API. Unless you Override a method (which you cannot for this), you have to use setRunning as it comes from the API (settings.setRunning(boolean)). Quote Link to comment Share on other sites More sharing options...
Muffins Posted September 19, 2015 Share Posted September 19, 2015 I'm trying to get setRunning to work. I've set up the method to return true and I'm passing it a false parameter. public boolean setRunning(boolean run) { return true; } public psuedoLoop() { setRunning(false); } I'm sure I'm doing something wrong. I'm trying to set run off and I've tried all combinations of true and false returns and parameters. well returning true turns it on soo Quote Link to comment Share on other sites More sharing options...
daggerattacker81 Posted September 19, 2015 Author Share Posted September 19, 2015 This really has nothing to do with the OSBot API. Unless you Override a method (which you cannot for this), you have to use setRunning as it comes from the API (settings.setRunning(boolean)). I wasn't aware that setRunning was an extension of the settings class. Thank you! Quote Link to comment Share on other sites More sharing options...
Apaec Posted September 19, 2015 Share Posted September 19, 2015 well returning true turns it on soo What? no the method at the top does nothing at all. If you really wanted your own utility which it seems this guy was trying to do, you would do something like private boolean turnRun(boolean on) { return settings.setRunning(on); } Unless I misunderstood your post? xd apa I wasn't aware that setRunning was an extension of the settings class. Thank you! http://osbot.org/api/org/osbot/rs07/api/Settings.html#setRunning-boolean- gl Quote Link to comment Share on other sites More sharing options...
daggerattacker81 Posted September 19, 2015 Author Share Posted September 19, 2015 Another quick question: does localWalker automatically set on run if energy is above a certain percentage? If so, how do I disable this or circumvent it? Quote Link to comment Share on other sites More sharing options...
Tom Posted September 19, 2015 Share Posted September 19, 2015 Another quick question: does localWalker automatically set on run if energy is above a certain percentage? If so, how do I disable this or circumvent it? It does not, you have to handle running yourself Quote Link to comment Share on other sites More sharing options...
Alek Posted September 19, 2015 Share Posted September 19, 2015 It does not, you have to handle running yourself Tom is not correct. LocalWalker handles run because it calls WalkEvent. If you want you can construct your own walk event and set the parameters to disable or enable toggling run. There is also an option to set the threshold in the event. 1 Quote Link to comment Share on other sites More sharing options...
Tom Posted September 19, 2015 Share Posted September 19, 2015 Tom is not correct. LocalWalker handles run because it calls WalkEvent. If you want you can construct your own walk event and set the parameters to disable or enable toggling run. There is also an option to set the threshold in the event. I think you're speaking a bit too technically for OP 1 Quote Link to comment Share on other sites More sharing options...
Joseph Posted September 19, 2015 Share Posted September 19, 2015 well returning true turns it on sooNoob lolThe method above will always return true. Quote Link to comment Share on other sites More sharing options...
daggerattacker81 Posted September 19, 2015 Author Share Posted September 19, 2015 Tom is not correct. LocalWalker handles run because it calls WalkEvent. If you want you can construct your own walk event and set the parameters to disable or enable toggling run. There is also an option to set the threshold in the event. I'll look into making my own walking event since local walker doesn't really do much of what I want it to do. Error checking whether or not my bot has arrived at a position is a pain with local walker as far as I know. http://osbot.org/api/org/osbot/rs07/event/WalkingEvent.html - This is all I've got to work with for creating a new walking event, right? Quote Link to comment Share on other sites More sharing options...
Flamezzz Posted September 19, 2015 Share Posted September 19, 2015 I'll look into making my own walking event since local walker doesn't really do much of what I want it to do. Error checking whether or not my bot has arrived at a position is a pain with local walker as far as I know. http://osbot.org/api/org/osbot/rs07/event/WalkingEvent.html - This is all I've got to work with for creating a new walking event, right? Ye, for example: WalkingEvent e = new WalkingEvent(new Position(0,0,0)); e.setEnergyThreshold(100); boolean ret = bot.getEventExecutor().execute(e).hasFinished(); I'm not sure why every setter is chainable except setEnergyThreshold Quote Link to comment Share on other sites More sharing options...