These questions you ask are very basic things you can figure out by checking out the API: http://osbot.org/api not only you need this but basic understanding of what your script needs to do. How can you as a legitimate player check if you picked up an item? By checking your inventory. That's what your script has to do then aswell.
For your scripts I suggest you first analyze what your script has to do and how it would do these procedures. To know how to do it, just log in on runescape and to it manually. Then you can start going to the API and apply the knowledge you gathered from doing it manually and search the right method for your procedure.