Jump to content

setRunning Problems


Recommended Posts

Posted

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

Posted

well returning true turns it on soo

 

What?

 

no :o 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

Posted

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

  • Like 1
Posted

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?

Posted

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 sad.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...