Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • GrandExchange handler


    TheMcPker

    Recommended Posts

    Hey guys a quickupdate on what i done so far 

     

    i think beginner scripters wil like these one's alot since it simplifies things alot

     

    goGeneral() what this does is

     

    if grandExchange is not open it wil call the open() method

    if grandExchange is in buy or sell it will use the back button (this has a 2% chance to missclick 1x on the goback button and then click it propperly)

     

    openSell() & openBuy()

     

    if grandExchange is not open it wil call the open() method

    if grandExchange is not opend on  the correct screen it will go to the right screen example its on sell screen and you call the openBuy() it wil first go to General and then to Buy

    it wil open a ranomized avalible slot so no need to do something like getGrandExchange().openBuyscreen(getGrandExchange().getFirstOpenSlot()); like i said it wil be randomized so could be a potential anti-ban

     

    will be focusing on buyItem and sellItem tommoro with things like WaitForItem(String item,int seconds) where script wil wait for the item to be bought/sold for the specified amount of seconds and ofcourse when its done buying/selling it wil collect it  :)

     

    hope you guys can give me some cool idea's on what more to include 

    Link to comment
    Share on other sites

    I think the api is fine for beginners, it is the implementation itself that is rough. isBuyOpen returns false after you search an item for example

    yea i don't find the current api for grandexchange very  beginner friendly and i think it could be simplified so much which is why im doing this now to make stuff for my self easier + for any other scripter that doesn't wanna do anything grandexchange related due to the tiny bit complexity of it (no offence to any of the developers at all i really enjoy most of the api but this is just my personal opinion and i understand you guys are busy so i decided to do it my self)

    Link to comment
    Share on other sites

    • 1 month later...

    When will the finished snippet be completed?

    Never.. this guy just says he will do something and never actually does it. This has not been the first time

    Link to comment
    Share on other sites

    • 3 weeks later...
    public int checkSearchVisable(String item){
    		getGrandExchange().searchItem(item);
    		sleepUntil(() -> getGrandExchange().itemVisible(getGrandExchange().getItemChildInSearch(item)), 2500);
    		if(!getGrandExchange().itemVisible(getGrandExchange().getItemChildInSearch(item))){
    			getGrandExchange().scrollToItem(getGrandExchange().getItemChildInSearch(item));
    			sleepUntil(() -> getGrandExchange().itemVisible(getGrandExchange().getItemChildInSearch(item), 2500);
    		}
    		return 0;
    	}
    

    Didn't know if you already had something for it but if not, here you go.

    package Methods;
    
    import org.dreambot.api.methods.grandexchange.GrandExchangeItem;
    import org.dreambot.api.wrappers.items.Item;
    
    import Core.Main;
    import Manager.MethodManager;
    
    public class GrandExchange extends MethodManager {
    	
    	public GrandExchange(Main s) {
    		super(s);
    	}
    
    	public int OpenGeneral(){
    		if(!s.getGrandExchange().isGeneralOpen()){
    			if(s.getGrandExchange().isBuyOpen()){
    				s.getGrandExchange().goBack();
    				s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    				return 0;
    			}else if(s.getGrandExchange().isSellOpen()){
    				s.getGrandExchange().goBack();
    				s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    				return 0;
    			}else{
    				s.getGrandExchange().open();
    				s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    				return 0;
    			}
    		}
    		return 0;
    	}
    	public int OpenSell(int tab){
    		if(!s.getGrandExchange().isSellOpen()){
    			if(!s.getGrandExchange().isGeneralOpen()){
    				if(s.getGrandExchange().isBuyOpen()){
    					s.getGrandExchange().goBack();
    					s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    					if(s.getGrandExchange().isGeneralOpen()){
    						s.getGrandExchange().openSellScreen(s.getGrandExchange().getFirstOpenSlot());
    						s.sleepUntil(() -> s.getGrandExchange().isSellOpen(), 2500);
    						return 0;
    					}
    				}else{
    					s.getGrandExchange().open();
    					s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    					s.getGrandExchange().openSellScreen(s.getGrandExchange().getFirstOpenSlot());
    					s.sleepUntil(() -> s.getGrandExchange().isSellOpen(), 2500);
    					return 0;
    				}
    			}else{
    				s.getGrandExchange().openSellScreen(s.getGrandExchange().getFirstOpenSlot());
    				s.sleepUntil(() -> s.getGrandExchange().isSellOpen(), 2500);
    				return 0;
    			}
    		}
    		return 0;
    	}
    	public int OpenBuy(){
    		if(!s.getGrandExchange().isBuyOpen()){
    			if(!s.getGrandExchange().isGeneralOpen()){
    				if(s.getGrandExchange().isSellOpen()){
    					s.getGrandExchange().goBack();
    					s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    					if(s.getGrandExchange().isGeneralOpen()){
    						s.getGrandExchange().openBuyScreen(s.getGrandExchange().getFirstOpenSlot());
    						s.sleepUntil(() -> s.getGrandExchange().isBuyOpen(), 2500);
    						return 0;
    					}
    				}else{
    					s.getGrandExchange().open();
    					s.sleepUntil(() -> s.getGrandExchange().isGeneralOpen(), 2500);
    					s.getGrandExchange().openBuyScreen(s.getGrandExchange().getFirstOpenSlot());
    					s.sleepUntil(() -> s.getGrandExchange().isBuyOpen(), 2500);
    					return 0;
    				}
    			}else{
    				s.getGrandExchange().openBuyScreen(s.getGrandExchange().getFirstOpenSlot());
    				s.sleepUntil(() -> s.getGrandExchange().isBuyOpen(), 2500);
    				return 0;
    			}
    		}
    		return 0;
    	}
    	
    	public int WaitForItemBuy(String item, int seconds){
    		for(GrandExchangeItem geItem : s.getGrandExchange().getItems()){
    			if(geItem.getName() == item && geItem.isBuyOffer()){
    				s.sleepUntil(() -> geItem.isReadyToCollect(), seconds*1000);
    			}
    		}
    		return 0;
    	}
    	
    	public int WaitForItemSell(String item, int seconds){
    		for(GrandExchangeItem geItem : s.getGrandExchange().getItems()){
    			if(geItem.getName() == item && geItem.isSellOffer()){
    				s.sleepUntil(() -> geItem.isReadyToCollect(), seconds*1000);
    			}
    		}
    		return 0;
    	}
    	
    	public int boughtAmount(String item){
    		for(GrandExchangeItem geItem : s.getGrandExchange().getItems()){
    			if(geItem.getName() == item && geItem.isBuyOffer()){
    				return geItem.getTransferredAmount();
    			}
    		}
    		return 0;
    	}
    	
    	public int soldAmount(String item){
    		for(GrandExchangeItem geItem : s.getGrandExchange().getItems()){
    			if(geItem.getName() == item && geItem.isSellOffer()){
    				return geItem.getTransferredAmount();
    			}
    		}
    		return 0;
    	}
    	
    	public int checkSearchVisable(String item){
    		s.getGrandExchange().searchItem(item);
    		s.sleepUntil(() -> s.getGrandExchange().itemVisible(s.getGrandExchange().getItemChildInSearch(item)), 2500);
    		if(!s.getGrandExchange().itemVisible(s.getGrandExchange().getItemChildInSearch(item))){
    			s.getGrandExchange().scrollToItem(s.getGrandExchange().getItemChildInSearch(item));
    			s.sleepUntil(() -> s.getGrandExchange().itemVisible(s.getGrandExchange().getItemChildInSearch(item), 2500);
    		}
    		return 0;
    	}
    }
    
    

    This is all I've got for myself

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.