1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question API to step through path without minimap, and stopping a bot.

Discussion in 'Developer Support' started by Jimbo73, Oct 13, 2015.

  1. Jimbo73

    Joined:
    Oct 4, 2015
    Messages:
    3
    Likes Received:
    0
    Hi guys,

    Not sure if you would prefer 2 separate threads for these questions.

    1. I need to run along a path without the minimap. I've created my own logic for this, but there are some small bugs, such as a tile not being visible sometimes which trips up the interact with that tile, and other small issues with running around. I'd rather use an API call that I can rely on, instead of spending hours working this out. I have found Path classes, but they all seem to use the minimap. Is there any Path API that will step by clicking on the ground, rather than the minimap?

    2. Whenever I stop my bot via the big stop button on the Runemate client, it continues to execute code. It's usually going through a loop when this happens, and when I click stop, I can see the loop continue to print things to console and I can feel the camera turning automatically. I tried overriding onStop() with super.onStop() and then System.exit(this won't work, it kills Runemate completely) and return; (didn't make a difference).
     
  2. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,606
    Likes Received:
    990
    1. What you're after is a ViewPortPath which is found here in the jdocs

    2. We highly recommend for you to NEVER use loops (both for and while) where not absolutely necessary for this very reason. Your bots logic should allow it to automatically jump back to the position it needs to be at on the next loop of onLoop. For things like dropping an inventory of items etc what i do is when the inventory is full, set the loop delay to 0 and a boolean to true. then drop an item. now in the next loop it will check if the boolean is true, and if it is we know we still need to drop items, so it goes back to the drop method and drops the next one. Then, inside the drop method we check if we have any of the items left, if we don't we set the boolean to false and the loop back to what it should be.

    Hope that helps.

    Note: The reason your loop continues to execute when you stop the bot during a loops execution is because we don't force end bots. @Cloud can explain why (i can't remember :p)
     

Share This Page

Loading...