September 19, 201510 yr 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.
September 19, 201510 yr 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?
September 19, 201510 yr Author 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?
September 19, 201510 yr 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)).
September 19, 201510 yr 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
September 19, 201510 yr Author 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!
September 19, 201510 yr 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
September 19, 201510 yr Author 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?
September 19, 201510 yr 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
September 19, 201510 yr 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.
September 19, 201510 yr 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
September 19, 201510 yr well returning true turns it on sooNoob lolThe method above will always return true.
September 19, 201510 yr Author 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?
September 19, 201510 yr 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
Create an account or sign in to comment