April 30, 20178 yr Pretty sure you can check your messages: https://osbot.org/api/org/osbot/rs07/api/ui/Message.html
April 30, 20178 yr 3 minutes ago, GaetanoH said: Is there any way to check if an user is trading you? It's been a while getTrade().isCurrentlyTrading()
April 30, 20178 yr Author Yeah, getType returns a: receivedTrade. Thank you! Just now, scape said: getTrade().isCurrentlyTrading() That's when you are already trading, I ment getting the trade request
April 30, 20178 yr 2 minutes ago, GaetanoH said: Yeah, getType returns a: receivedTrade. Thank you! That's when you are already trading, I ment getting the trade request If you're trying to check that a certain user send the request, you can parse the game message using the API class I sent in my previous post. Edited April 30, 20178 yr by harrypotter
April 30, 20178 yr 18 minutes ago, GaetanoH said: Yeah, getType returns a: receivedTrade. Thank you! That's when you are already trading, I ment getting the trade request I made this to grab the name from messages: public String getNameFromTrade(String s) { String line = ""; for (int i = 0; i < s.length(); i++) { if (s.substring(i, i + 4).contains("wish")) break; else line += s.substring(i, i + 1); } return line; }
April 30, 20178 yr https://osbot.org/api/org/osbot/rs07/api/Trade.html#getLastRequestingPlayer-- If this returns null you don't have one, I'm pretty sure it only checks for the past 15 seconds or so
April 30, 20178 yr Author 32 minutes ago, scape said: I made this to grab the name from messages: public String getNameFromTrade(String s) { String line = ""; for (int i = 0; i < s.length(); i++) { if (s.substring(i, i + 4).contains("wish")) break; else line += s.substring(i, i + 1); } return line; } Lol, you can check it from the Message API man, if(msg.getType() == Message.MessageType.RECEIVE_TRADE){ log("TRADING: " + msg.getUsername()); }
Create an account or sign in to comment