Jump to content

Interface based condition not working? halp pl0x


blabla123

Recommended Posts

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2457,3105,0));
				sleep(random(2000,2200));
			} else if (balloonGuy != null && !client.getInterface(469).isVisible()) { 
				if(balloonGuy.isVisible()) {
					balloonGuy.interact("Fly");
					sleep(random(2000,2200));
				}
			} else if (client.getInterface(469).isVisible()) {     // this seems to be doing nothing, where did I do a mistake?
				client.getInterface(469).getChild(26).interact();
				sleep(random(8000,9000));
			}

So I walk up to the guy, interact with him - the interface opens up. Then it waits a little while, closes the interface and interacts with the guy again - like it ignores the last "else if" completely.

 

Also if anyone knows of some rectangle area interaction thread where it was discussed - a link would be appreciated as I remember seeing it somwhere and even following it, but somehow the list of threads I follow is being reset like quite often :/

Link to comment
Share on other sites

Declared

final RS2Interface parent = client.getInterface(469);

at the beginning of my onLoop(). Then changed the code in the body to this:

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2457, 3105, 0));
				sleep(random(2000, 2200));
			} else if (balloonGuy != null) {
				if (balloonGuy.isVisible()) {
					balloonGuy.interact("Fly");
					sleep(random(2000, 2200));
				} else {
					client.moveCameraToEntity(balloonGuy);
				}
			} else if (parent != null) { // change here
				if (client.getInterface(469).isVisible()) {
					client.getInterface(469).getChild(25).interact();
					sleep(random(8000, 9000));
				}
			}

And it still does the same thing...

Link to comment
Share on other sites

Thanks Swizz...

if (player.getPosition().distance(new Position(2456, 3093, 0)) <= 4) {
				walkMiniMap(new Position(2456 +random(0,2), 3104 +random(0,2), 0));
				sleep(random(2000, 2200));
			} else if (balloonGuy != null && !new ColorPicker(bot).isColorAt(275, 175, new Color(168, 144, 97))) {
				if (balloonGuy.isVisible()) {
					if(!player.isMoving()) {
						balloonGuy.interact("Fly");
						sleep(random(2000, 2200));
					}
				} else {
					client.moveCameraToEntity(balloonGuy);
				}
			} else if (new ColorPicker(bot).isColorAt(275, 175, new Color(168, 144, 97))) { //gotta love color picker
					client.moveMouseTo(new RectangleDestination(365, 40,
							70, 15), false, true, false);
					sleep(random(8000,9000));
			}
Edited by blabla123
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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