Jump to content

Buying from shop with widget


Recommended Posts

Posted

Re-using old code that worked perfectly. I get stuck at the log "Store is open"

Any ideas why it's not finding the widget and proceeding with the method? 

It's not actually being used for grapes anymore, I'm just using the grape code. Widget numbers are correct for the new widget.

 

int buyGrapes() throws InterruptedException
	{
		if (store.isOpen()) {
			log("store is open");
			sleep(300);
		
			RS2Widget grapeWidge = getWidgets().get(300, 548, 300);
			if (grapeWidge != null)
			{
				grapeCount = grapeWidge.getItemAmount();
				if (grapeCount > 0)
				{
					log("Shop in stock, buying");
					grapeWidge.interact("Buy 10");
					sleep(400);	
				}	
				else if (grapeCount == 0)
				{	
					getWorlds().hopToP2PWorld();	
					//state = State.HOP;
				}
			}								
	
		}
		return 0;
		
			
	}

 

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
  • Recently Browsing   0 members

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