How do i check if a shop is open and interact within the shop?
as the title says...
i got this:
Shop trading = new Shop(this);
if(trading.isOpen() && !client.getInventory().contains(unNotedEssence)){
ShopItem theEssence = trading.getShopItemByName("Pure essence");
client.getInventory().interactWithId(notedPureEssence, "Sell 10");
sleep(120);
theEssence.buy10();
} else {
NPC jimShop = closestNPC(jim);
jimShop.interact("Trade");
sleep(random(100, 1200));
}