Jump to content

2 simple questions


Recommended Posts

Posted

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

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...