Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Path Walking Error

Featured Replies

this is my loop

 

http://pastebin.com/JcAAhMb7

 

and this is what happens

 

d73520520bf3f22dda0b3e50e0a9edd1.gif

 

i i just don't know what to do now I'm completely stuck..

 

"go learn basic java" they say, 

trust me iv'e learnt it and studied it over and over, but no basic java tuts show me about paths for a runescape bot :L

 

pathwalking method

 

public void walkPath(Position[] path)
   throws InterruptedException
 {
   for (Position p : path) {
     if ((myPosition().distance(p) <= 16) && 
       (myPosition().distance(p) >= 3))
     {
       boolean success;
       do
       {
         success = walkTile(p);
       } while (!success);
     }
   }
 }
 
 public boolean walkTile(Position p)
   throws InterruptedException
 {
   if (myPosition().distance(p) > 13)
   {
     Position pos = new Position(
       (p.getX() + myPosition().getX()) / 2 + 
       MethodProvider.random(-3, 3), (p.getY() + myPosition().getY()) / 2 + 
       MethodProvider.random(-3, 3), myPosition()
       .getZ());
     walkTile(pos);
   }
   for (int i = 0; i < 2; i++)
   {
mouse.click(new MiniMapTileDestination(bot, p), false);
   }
   mouse.click(new MiniMapTileDestination(bot, p), false);
   int fail = 0;
   while ((myPosition().distance(p) > 2) && (fail < 10))
   {
     MethodProvider.sleep(500L);
     if (!myPlayer().isMoving()) {
       fail++;
     }
   }
   return fail != 10;
 } 

Edited by PwneRL33T

You should try and provide some more details, which methods are successively called for example ?

 

Edit: seems like walkPath(path2); is causing it, you should post the method / path in question ^^

Edited by Botrepreneur

  • Author

You should try and provide some more details, which methods are successively called for example ?

 

Edit: seems like walkPath(path2); is causing it, you should post the method / path in question ^^

 

done :)

done smile.png

 

Those are just the position arrays, mind posting the method you feed them in to ?

I'm talking about the walkPath(position array) method ^^

  • Author

Those are just the position arrays, mind posting the method you feed them in to ?

I'm talking about the walkPath(position array) method ^^

 

oh right sorry, added now

(p.getX() + myPosition().getX()) / 2 + 
       MethodProvider.random(-3, 3)
1) Parentheses!
 
((p.getX() + myPosition().getX()) / 2)
       MethodProvider.random(-3, 3)
 
Same applies to what you do for the Y coordinate.
 
2) Redundant action repetition
 
   for (int i = 0; i < 2; i++)
   {
mouse.click(new MiniMapTileDestination(bot, p), false); // YOU CLICK TWICE HERE
   }
   mouse.click(new MiniMapTileDestination(bot, p), false); // AND A THIRD TIME HERE
 
3) Awkward sleeping
 

The idea of having a fail counter isn't bad at all, this while loop makes no sense whatsoever though.

The fail int doesn't represent actual fails, just you not moving. After each fail you should probably retry the walkTile method instead of just sleeping again.

while ((myPosition().distance(p) > 2) && (fail < 10))
   {
     MethodProvider.sleep(500L);
     if (!myPlayer().isMoving()) {
       fail++;
     }
   }
^not very effective
 
 
 

Edited by Botrepreneur

http://osbot.org/forum/topic/55480-walker-with-basic-obstacle-handling/

The reason why it walks to the second position then walks back to the first is because you have only one loop, you loop though the position, since your looping from the beginning to the end. Your near the first position it will walk to the second, and once your walking it's still looping through the positions from the beginning so while your conditions are correct it will go back to the first. Why it's a never ending loop.

In swizz method he has two loop, regular loop, and a loop in reverse. He uses the reverse path to find the next furthest available position.

Rather then looping and finding the closest tile from the beginning of the loop.

If you don't understand me look at his method, get next tile and read it

Edited by josedpay

  • Author

I like your profile pic, what type?

 

hah cheers, just sold it the other day though and got a mercedes benz :P 

 

its a VY 5sp

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.