evert123 Posted September 28, 2017 Posted September 28, 2017 Hello guys, I'm working on a selling script, my player stands at Lumby bank and is selling Varrock teleports. Now I got stuck at how to know if someone is trading my player and how to prevent trading someone after selling them runes. I was thinking something like this: Get first line in chatbox If contains trade requests get name trade player My problems are: 1. I have very little knowledge of Java, working with lists is kinda new for me (do have some Python exp) 2. I don't know how the chat API of OSBot will return the messages (Will it only return trade message if i put public off? Will it return every message? Is the first message at the top or at the bottom of this list) If someone knows anything on this subject I would really appreciate some explanation on the topics.
Night Posted September 28, 2017 Posted September 28, 2017 Take a look at messagelistening, this will help notify you when you receive a message and give you the name of the player who sent it. 1
Viston Posted September 28, 2017 Posted September 28, 2017 Use getTrade() and get the last requesting player. Then gets his name, and store it. 1
evert123 Posted September 28, 2017 Author Posted September 28, 2017 Thx! For showing me which directions to explorer.