Jump to content
Sign in to follow this  
shaiguy

need help web walking

Recommended Posts

Posted (edited)

New to scripting and been trying to figure out how to walk but I cannot do it. 

I'm not sure where to really start. I've been trying to utilize RSArea with walkTo.

    private final RSArea WALK_SPOT = new RSArea(null);
 

don't know what to put in the null spot. 

 

A simple snippit of walking from lumby to lumby bridge would be very beneficial to me. Thanks for reading. 

 

edit: I have tried Snufflez suggestion and it worked. Would this be the way to do things if I want to walk from say lumbridge to varrock sewers to then continue walking to kill zombies? 

 

Edited by shaiguy

Share this post


Link to post
Share on other sites
22 minutes ago, Snufflez said:

Try creating an RSTile (one tile on the map) and then walking to that. 

 

RSTile tile = new RSTile(x,y,);

And then 

WebWalking.walkTo(tile);

 

 

 

Would this be the way to do things if I want to walk from say lumbridge to varrock sewers to then continue walking to kill moss giants? 

Share this post


Link to post
Share on other sites

To create an area with RSArea you need to specify 2 tiles in the parameters. This creates a rectangle area using the two tiles specified as two opposite corners (You want to pick a NE+SW tile, or a NW+SE Tile) Then, you can use Webwalking to walk to AREA_NAME.getRandomTile.

2 minutes ago, shaiguy said:

 

Would this be the way to do things if I want to walk from say lumbridge to varrock sewers to then continue walking to kill moss giants? 

Yes, and no. The standard web walker doesn't handle most dungeons/obstacles. Using the regular web walker, you'd have to walk to the varrock sewers entrance, and then when the entrance is nearby, you'd have to interact with it to enter the sewers. Repeat with any obstacles between you and your end location.

Alternatively, you could look into using DaxWebWalker, which handles many dungeons already, and is open source. If you're utilizing his web-walker you could simply web walk to the location with just the one line of code. If you do this though, you should add a failsafe, because sometimes the free API key hits the call limit.

  • Like 3

Share this post


Link to post
Share on other sites
1 hour ago, Snufflez said:

Yeah, just set the tile coords to the sewers entrance, web walk, climb into the sewers (possibly supported automatically by webwalking?) and then walk to moss giants

 

1 hour ago, Adventure_Time said:

To create an area with RSArea you need to specify 2 tiles in the parameters. This creates a rectangle area using the two tiles specified as two opposite corners (You want to pick a NE+SW tile, or a NW+SE Tile) Then, you can use Webwalking to walk to AREA_NAME.getRandomTile.

Yes, and no. The standard web walker doesn't handle most dungeons/obstacles. Using the regular web walker, you'd have to walk to the varrock sewers entrance, and then when the entrance is nearby, you'd have to interact with it to enter the sewers. Repeat with any obstacles between you and your end location.

Alternatively, you could look into using DaxWebWalker, which handles many dungeons already, and is open source. If you're utilizing his web-walker you could simply web walk to the location with just the one line of code. If you do this though, you should add a failsafe, because sometimes the free API key hits the call limit.

 

Hi again. Sorry for the bother. 

I manage to walk a short distance ( varrock center to a few tiles away)

But when I try to do varrock center to the sewer entrance, it doesn't walk. 

I tried using WebWalking but it broke right away with EGWPosition

Here's what I'm trying: 

    private RSTile WALK_SPOT = new RSTile(3236,3457,0);
private int toSpot()
    {
        if (!Player.getPosition().equals(WALK_SPOT));
        {
                        
            //break telly 
            RSItem[] item = Inventory.find("Varrock Teleport");
            item[0].click("Break");
            
            Walking.walkTo(WALK_SPOT);
            
            //enter entrance
            
            RSObject[] manhole = Objects.findNearest(5, "Manhole");
            manhole[0].click("Climb-down");
            
            //walk to spot
            
            Walking.walkTo(WALK);
        }
        return 70;
    }

thanks for all the help guys. 

Share this post


Link to post
Share on other sites
Posted (edited)
18 minutes ago, shaiguy said:

Hi again. Sorry for the bother. 

I manage to walk a short distance ( varrock center to a few tiles away)

But when I try to do varrock center to the sewer entrance, it doesn't walk. 

I tried using WebWalking but it broke right away with EGWPosition

I believe this is because Walking.walkto only walks to a point visible on the minimap, so not a large tile radius. Try using WebWalking.walkTo for larger distances

Edit: re: the EGW position error, make sure you're importing 2007 not rs3 webwalking :)

Edited by Snufflez
reeeeeeeeeeeee
  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)
15 minutes ago, Snufflez said:

I believe this is because Walking.walkto only walks to a point visible on the minimap, so not a large tile radius. Try using WebWalking.walkTo for larger distances

Edit: re: the EGW position error, make sure you're importing 2007 not rs3 webwalking :)

that would be why, how do I get 2007 import to show? I'm only getting an import for rs3. 

 

 

edit: how do I use position able rather? 

edit2: I'm dumb, figured it out. thanks a ton. 

Edited by shaiguy

Share this post


Link to post
Share on other sites
Posted (edited)
4 minutes ago, shaiguy said:

that would be why, how do I get 2007 import to show? I'm only getting an import for rs3. 

delete the rs3 import code at the top and depending on your IDE i think you can click on the webwalking method to import again, select 07.

Or just paste ' import org.tribot.api2007.WebWalking ' at the top in place of the rs3

Edited by Snufflez
formatting

Share this post


Link to post
Share on other sites
2 hours ago, shaiguy said:

Hi again. Sorry for the bother. 

I manage to walk a short distance ( varrock center to a few tiles away)

But when I try to do varrock center to the sewer entrance, it doesn't walk. 

I tried using WebWalking but it broke right away with EGWPosition

Here's what I'm trying: 

 

Your code might not work as intended.

I've commented a few things:

private RSTile WALK_SPOT = new RSTile(3236,3457,0);

private int toSpot()
    {
        if (!Player.getPosition().equals(WALK_SPOT));
        {
                        
            
            RSItem[] item = Inventory.find("Varrock Teleport");
            item[0].click("Break"); // This could throw an Array Index out of bounds exception
            
            Walking.walkTo(WALK_SPOT); // How do you know if item[0] was actually clicked?
            
            
            RSObject[] manhole = Objects.findNearest(5, "Manhole");
            manhole[0].click("Climb-down"); // This could also throw an Array Index out of bounds exception
            // The climb down option is only available if the manhole is open
           
            Walking.walkTo(WALK);
        }
        return 70; // Remove this
    }

 

 

Try this instead:

 

private static final RSArea VARROCK_AREA = new RSArea(new RSTile(3206, 3421, 0), new RSTile(3240, 3460, 0));
private static final RSTile MANHOLE_TILE = new RSTile(3237, 3457, 0);

private void getInSewers() {
	if (Player.getPosition().getY() > 9850) {
		General.println("Player is already in sewers.");
		return;
	}

	if (!VARROCK_AREA.contains(Player.getPosition())) {
		if (Clicking.click(Inventory.find("Varrock Teleport"))) // If successfully clicked tab
			Timing.waitCondition(new Condition() { // Wait to arrive in Varrock 
				@Override
				public boolean active() {
					General.sleep(300);
					return VARROCK_AREA.contains(Player.getPosition());
				}
			}, General.random(4000, 6000));
	} else {
		// Else if player is already in Varrock area
		RSObject[] manhole = Objects.findNearest(5, "Manhole");
		if (manhole.length == 0 || !manhole[0].isOnScreen()) {
			Walking.blindWalkTo(MANHOLE_TILE);
		} else {
			if (manhole[0].getID() == 881) { // The lid is on
				if (manhole[0].click("Open")) /// If successfully clicked "Open"
					Timing.waitCondition(new Condition() { // Wait to remove lid
						@Override
						public boolean active() {
							General.sleep(300);
							return Objects.findNearest(3, 882).length > 0;
						}
					}, General.random(5000, 8000));
			} else { // The lid is off
				if (manhole[0].click("Climb-down")) // If successfully clicked "Climb-down"
					Timing.waitCondition(new Condition() { // Wait until the player is inside the sewers
						@Override
						public boolean active() {
							General.sleep(300);
							return Player.getPosition().getY() > 9850; // inside sewers
						}
					}, General.randomLong(2000, 4000));
			}
		}
	}
}

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
6 hours ago, Einstein said:

 

Your code might not work as intended.

I've commented a few things:

private RSTile WALK_SPOT = new RSTile(3236,3457,0);

private int toSpot()
    {
        if (!Player.getPosition().equals(WALK_SPOT));
        {
                        
            
            RSItem[] item = Inventory.find("Varrock Teleport");
            item[0].click("Break"); // This could throw an Array Index out of bounds exception
            
            Walking.walkTo(WALK_SPOT); // How do you know if item[0] was actually clicked?
            
            
            RSObject[] manhole = Objects.findNearest(5, "Manhole");
            manhole[0].click("Climb-down"); // This could also throw an Array Index out of bounds exception
            // The climb down option is only available if the manhole is open
           
            Walking.walkTo(WALK);
        }
        return 70; // Remove this
    }

 

 

Try this instead:

 

private static final RSArea VARROCK_AREA = new RSArea(new RSTile(3206, 3421, 0), new RSTile(3240, 3460, 0));
private static final RSTile MANHOLE_TILE = new RSTile(3237, 3457, 0);

private void getInSewers() {
	if (Player.getPosition().getY() > 9850) {
		General.println("Player is already in sewers.");
		return;
	}

	if (!VARROCK_AREA.contains(Player.getPosition())) {
		if (Clicking.click(Inventory.find("Varrock Teleport"))) // If successfully clicked tab
			Timing.waitCondition(new Condition() { // Wait to arrive in Varrock 
				@Override
				public boolean active() {
					General.sleep(300);
					return VARROCK_AREA.contains(Player.getPosition());
				}
			}, General.random(4000, 6000));
	} else {
		// Else if player is already in Varrock area
		RSObject[] manhole = Objects.findNearest(5, "Manhole");
		if (manhole.length == 0 || !manhole[0].isOnScreen()) {
			Walking.blindWalkTo(MANHOLE_TILE);
		} else {
			if (manhole[0].getID() == 881) { // The lid is on
				if (manhole[0].click("Open")) /// If successfully clicked "Open"
					Timing.waitCondition(new Condition() { // Wait to remove lid
						@Override
						public boolean active() {
							General.sleep(300);
							return Objects.findNearest(3, 882).length > 0;
						}
					}, General.random(5000, 8000));
			} else { // The lid is off
				if (manhole[0].click("Climb-down")) // If successfully clicked "Climb-down"
					Timing.waitCondition(new Condition() { // Wait until the player is inside the sewers
						@Override
						public boolean active() {
							General.sleep(300);
							return Player.getPosition().getY() > 9850; // inside sewers
						}
					}, General.randomLong(2000, 4000));
			}
		}
	}
}

 

thank you very much for the input. Last night I was just trying to get it to do what I wanted then I would work out the kinks. 

This is very useful though. Thanks again.

Share this post


Link to post
Share on other sites
2 hours ago, shaiguy said:

thank you very much for the input. Last night I was just trying to get it to do what I wanted then I would work out the kinks. 

This is very useful though. Thanks again.

 

You're welcome! :)

If you need more help, feel free to send me a PM. 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Our picks

    • This release will:

      Add LG support for Runelite


      Fix NPCChat issues


      Fix a bug where the camera angle setter would just hold down a key for 5 seconds (the timeout)


      Slightly adjust the rotation via keys to be more accurate


      Add the ability for asynchronous camera movement via keys


      Make Camera rotation via mouse more fluid, with more antiban, and work much better in resizable mode


      Add a "Camera#setCamera" method, allowing the rotation and angle to be set in parallel


      Increase the likelihood of using the mouse for camera movements


      Add support for adjusting the camera to positionable entities (Positionable#adjustCameraTo)



      Upcoming updates:

      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Thanks
        • Like
      • 42 replies
    • This update will:

      Allow for clicking through the chat box when possible (Thanks @Todd)


      Fix Combat#selectIndex (Thanks @Encoded)


      Ensure worlds stay sorted and added a check to avoid misclicks in the in-game world hopper (Thanks @erickho123)


      Fix out-dated Options API interface indices (Thanks @Todd)



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 12 replies
    • This release will:

      Fix login bot after today's game update (Thanks @JoeDezzy1)


      Fix latest in-game world hopping issues (Thanks @erickho123)


      Compact Settings UI and set location relative to TRiBot (Thanks @JoeDezzy1)


      Fix an older implementation of GrandExchange#getWindowState (Thanks @JoeDezzy1)


      Improve the preformance of NPCChat by only searching in certain interface parents (Thanks @JoeDezzy1)



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      LG support for RuneLite


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Thanks
        • Like
      • 16 replies
    • This release will:

      Fix bytecode manipulation in order to prevent the modification of parameters within the Filter and Condition classes themselves (thanks @wastedbro)


      Fix NPE caused by non-null value in GE API (thanks @erickho123)


      Add and fix equals methods for api2007.types (thanks @JoeDezzy1)


      Modify Mouse#leaveGame to make the mouse leave the game from top, left, right, or bottom (thanks @erickho123)


      Add Entrana area to Ships API (thanks @erickho123)


      Fix raid prayers index/settings in Prayer API (thanks @erickho123)



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Like
      • 29 replies
    • This update will:

      Implement better canvas locking/synchronization mechanism


      Fix small Login API bug


      Remove the requirement for xbooting Java classes


      Use ExecutorService to perform canvas work in parallel


      Add "Account Management" game tab to GameTab API (thanks @Encoded)


      Fix NPCChat#getMessage (thanks @Encoded )


      Fix NPCChat#selectOption (thanks @Encoded )


      Fix Banking API after today's update (thanks @Encoded )


      Fix in-game world hopper after today's update (thanks @Encoded )



      Upcoming updates:

      Break handler bug fix


      Improved CLI support


      Much more



      Note: If you are using LG, please restart both the RS client and TRiBot
        • Thanks
        • Like
      • 38 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×