Jump to content

2 simple questions


futurepasts

Recommended Posts

So i wanted to ask about depositBox is it broken now? Because i founded on api this

depositBox.open();

But it doesn't open deposit box i stand near box

 

 

 

And 2nd question about shop buying

 

 

 I made script that buys simple few items then hop and do this till full inventory,it does everything perfectly except it sometimes after hoping world while buying items try to buy it like 10 times even if i have function if (store.getAmount("Shop item") == 0)

and then hops sometimes i need to restart script to get it working again :/

 

 

My code of buying items

NPC SHOP NPC= npcs.closest("SHOP NPC");
			if (SHOP NPC!= null)  {
				if(SHOP NPC.isVisible()) {
					SHOP NPC.interact("Trade");
					sleep(random(2000, 2500));
					store.buy(ITEM ID, AMOUNT);
					sleep(random(500, 600));
					store.buy(ITEM , AMOUNT);
					sleep(random(500, 600));
					store.buy(ITEM , AMOUNT
					sleep(random(600,900));
					if (store.getAmount("SHOP ITEM") == 0)
					{
						
						worlds.hopToF2PWorld();
					}
			}
			 }

My states 

NPC SHOP NPC= npcs.closest("SHOP NPC");
		if (!inventory.isFull() && Shoparea.contains(myPlayer())
				&& SHOP NPC!= null)
			return State.BUY;
		if (!inventory.isFull() && BankArea.contains(myPlayer()))
			return State.WALK_TO_SHOP;
		if (inventory.isFull() && Shoparea.contains(myPlayer()))
				return State.BANK;
		return State.WAIT;
	}
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...