Jump to content

Buying from shop with widget


uyfgfarOS

Recommended Posts

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;
		
			
	}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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