hansen19498 Posted December 8, 2016 Share Posted December 8, 2016 (edited) when trade.isSecondInterfaceOpen, I can not read the number of other items, the use of what "api" or a good solution? (I was deceived, the first transaction window and the second transaction window, the number of different items) If, isSecondInterfaceOpen, what "api" can read each other "value" SecondInterfaceOpen, but the other has quickly removed items, bot in the automatic trading time, but no way to detect, because the final step of the transaction, can only determine whether the other party to accept ,,,, I hope that the last step through what verification Edited December 8, 2016 by hansen19498 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 What? Quote Link to comment Share on other sites More sharing options...
hansen19498 Posted December 8, 2016 Author Share Posted December 8, 2016 SecondInterfaceOpen, but the other has quickly removed items, bot in the automatic trading time, but no way to detect, because the final step of the transaction, can only determine whether the other party to accept ,,,, I hope that the last step through what verification Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 SecondInterfaceOpen, but the other has quickly removed items, bot in the automatic trading time, but no way to detect, because the final step of the transaction, can only determine whether the other party to accept ,,,, I hope that the last step through what verification I, don't, understand, what you, are asking, me. Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted December 8, 2016 Share Posted December 8, 2016 Doesn't this work? getTrade().getTheirOffers() getTrade().getOurOffers() 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 (edited) Doesn't this work? getTrade().getTheirOffers() getTrade().getOurOffers() That works. I have it in one of my scripts. Not sure if that's what he is asking about. Edited December 8, 2016 by Juggles 1 Quote Link to comment Share on other sites More sharing options...
hansen19498 Posted December 8, 2016 Author Share Posted December 8, 2016 没有这方面的工作? getTrade()。getTheirOffers() getTrade()。getOurOffers() if(trade.isFirstInterfaceOpen()) {CNUM=trade.getTheirOffers().getAmount("rune ore");log("CNUM="+CNUM)}//CNUM=10 //but if(trade.isSecondInterfaceOpen()) {CNUM=trade.getTheirOffers().getAmount("rune ore");log("CNUM="+CNUM)}//CNUM=0 it isnt working 这样可行。我有它在我的剧本之一。 不知道那是什么,他是问。 Clearly, when the second trading window opens, trade.getTheirOffers().getAmount it isnot working Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 if(trade.isFirstInterfaceOpen()) {CNUM=trade.getTheirOffers().getAmount("rune ore");log("CNUM="+CNUM)}//CNUM=10 //but if(trade.isSecondInterfaceOpen()) {CNUM=trade.getTheirOffers().getAmount("rune ore");log("CNUM="+CNUM)}//CNUM=0 it isnt working Clearly, when the second trading window opens, trade.getTheirOffers().getAmount it isnot working Quote Link to comment Share on other sites More sharing options...
hansen19498 Posted December 8, 2016 Author Share Posted December 8, 2016 why laugh? Give me some advice, and beg you .......... Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 8, 2016 Share Posted December 8, 2016 why laugh? Give me some advice, and beg you .......... What does this mean? ;log("CNUM="+CNUM)}//CNUM=0 Quote Link to comment Share on other sites More sharing options...
hansen19498 Posted December 8, 2016 Author Share Posted December 8, 2016 What does this mean? ;log("CNUM="+CNUM)}//CNUM=0 You win, I do not want to ask you again, I'm sorry Doesn't this work? getTrade().getTheirOffers() getTrade().getOurOffers() u can help me ?please Quote Link to comment Share on other sites More sharing options...
qverkk Posted December 9, 2016 Share Posted December 9, 2016 (edited) what i have understood is you want to check item amount in second trade window, I don't think that getTheirOffers() / getOurOffers() works in this case It might be possible to do so using this (@TheScrub) public List<TradeItem> getItemsSecondaryScreen(String text) throws ParseException { ArrayList<TradeItem> list = new ArrayList<TradeItem>(); if (text == null || !text.contains("<br>")) { return list; } String items[] = text.split("<br>"); for (String s : items) { String[] itemData = s.split("<col=[0-9A-Fa-f]{6}>"); if (itemData.length == 2) { list.add(new TradeItem(itemData[1])); } else if (itemData.length == 4) { list.add(new TradeItem(itemData[1], parseQuantity(itemData[3]))); } else { try { throw new Exception("Sorry please check the item"); } catch (Exception e) { e.printStackTrace(); } } } return list; } private int parseQuantity(String text) throws ParseException { if (text == null) { return -1; } if (text.contains("(") && text.contains(")")) { text = text.substring(text.indexOf('(') + 1, text.indexOf(')')); NumberFormat.getIntegerInstance(java.util.Locale.US).parse(text) .intValue(); } return NumberFormat.getIntegerInstance(java.util.Locale.US).parse(text) .intValue(); } public class TradeItem { private String name; private boolean stackable; private int amount; public TradeItem(String name) { this.name = name; this.stackable = false; this.amount = 1; } public TradeItem(String name, int amount) { this.name = name; this.amount = amount; this.stackable = true; } public String getName() { return this.name; } public int getAmount() { return this.amount; } public boolean isStackable() { return this.stackable; } } anyways, why do you have to detect it? Edited December 9, 2016 by qverkk Quote Link to comment Share on other sites More sharing options...