Jump to content

setRunning Problems


daggerattacker81

Recommended Posts

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.

Link to comment
Share on other sites

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?

  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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