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
  • Check if person you are trading with accepted the trade.


    ABM

    Recommended Posts

    Posted

    Is it possible? 

    Been checking API and can't find a way to do it.

    Posted

    By this I mean when you are in the actual trade screen.

     

    For example, if a person has accepted the first screen. 

    Posted

    Each part of a trade has a seperate ID you can do something like 

    if(getTrade().isOpen(1)){
    	// Do shit in the first trade window
    	// offer/check if items are offered
    	getTrade().acceptTrade(1);
    
    }
    
    if(getTrade().isOpen(2){
    	getTrade().acceptTrade(2);
    }

    might want to check the API documentation for all of this because I am typing this from my phone might be off a bit.

    Posted

    That would check if the trade is open,

    and then accept it,

     

    what I am looking for is to check if other parties in the trade involved in the trade has accept the first screen of the trade,

    so if the screen like this:

    https://prnt.sc/nhh5aq

    it returns true or something.

    Posted
    1 hour ago, ABM said:

    That would check if the trade is open,

    and then accept it,

     

    what I am looking for is to check if other parties in the trade involved in the trade has accept the first screen of the trade,

    so if the screen like this:

    https://prnt.sc/nhh5aq

    it returns true or something.

    ahhh sorry, yeah what Mila said you would want widgets, I am extremly intoxicated atm srry. 

    Posted
        public boolean accepted() {
            if(!script.getTrade().isOpen()){
              return false;
            }
          
            WidgetChild w = null;
            if (script.getTrade().isOpen(1) == 1) {
                w = script.getWidgets().getWidgetChild(335, 30);
            } else {
                w = script.getWidgets().getWidgetChild(334, 4);
            }
    
            return w != null && w.isVisible() && w.getText().toLowerCase().contains("player has accepted");
        }

    Not sure about the numbers on the widgets though, you should double check

    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.