fixthissite Posted January 20, 2015 Share Posted January 20, 2015 (edited) I've seen waaaay worse when it comes to documentation, so I'm not saying it could be better based on comparisons. Since I can't run scripts and test functions (no old school RuneScape account), I'm attempting to write scripts using what I can scrape from the documentations. I have quite a few questions about some functions that can really only be answered through testing or documentation, for example: Bank#open() - "Searches for the best bank, based on type and distance of player" I'm assuming this searches for a bank within view. Of course, this is just an educated guess; I would have to test it to make sure. Maybe have something like "Searches for the best bank within sight, based on type and distance of player. Does nothing if no banks are in sight." Bank#getItems() - "Gets the array of items stored in this container" What's the container? The bank or a tab? If I call this method without the bank being open, what will happen? ______________________________________________________ It'll help out quite a bit, seeing how there's no test server. I'm sure it's the last thing you guys are worried about, but it's something that could definitely be improved. Thanks for taking the time to read this Edited January 20, 2015 by fixthissite Link to comment Share on other sites More sharing options...
Joseph Posted January 20, 2015 Share Posted January 20, 2015 (edited) I've seen waaaay worse when it comes to documentation, so I'm not saying it could be better based on comparisons. Since I can't run scripts and test functions (no old school RuneScape account), I'm attempting to write scripts using what I can scrape from the documentations. I have quite a few questions about some functions that can really only be answered through testing or documentation, for example: Bank#open() - "Searches for the best bank, based on type and distance of player" I'm assuming this searches for a bank within view. Of course, this is just an educated guess; I would have to test it to make sure. Maybe have something like "Searches for the best bank within sight, based on type and distance of player. Does nothing if no banks are in sight." Bank#getItems() - "Gets the array of items stored in this container" What's the container? The bank or a tab? If I call this method without the bank being open, what will happen? ______________________________________________________ It'll help out quite a bit, seeing how there's no test server. I'm sure it's the last thing you guys are worried about, but it's something that could definitely be improved. Thanks for taking the time to read this bank#open looks for the closest bank booth. doesnt support npc bankers not sure about chest. Also it doesnt matter if it in sight i believe it will walk to entity and also rotate camera to the bank. Bank class extend item container. if bank isnt open then you simply get a null ps. the bank itself is a item container just like a shop and also inventory. Edited January 20, 2015 by josedpay 1 Link to comment Share on other sites More sharing options...
fixthissite Posted January 20, 2015 Author Share Posted January 20, 2015 if bank isnt open then you simply get a null It should mention that in the document's return clause /: And thanks for the information, especially about the bank booths! But I have a lot of questions.. Asking them all in a single thread would be overwhelming, and creating a bunch of new threads would clutter up the question area. I was just hoping someone, on their free time, might be able to polish up the documentation a bit Link to comment Share on other sites More sharing options...
Mysteryy Posted January 20, 2015 Share Posted January 20, 2015 It should mention that in the document's return clause /: And thanks for the information, especially about the bank booths! But I have a lot of questions.. Asking them all in a single thread would be overwhelming, and creating a bunch of new threads would clutter up the question area. I was just hoping someone, on their free time, might be able to polish up the documentation a bit Why should it mention that? If you ever try to get an object, interface, npc, or anything else, assume that if its not there it will return null. That is the only logical thing for a method to return when it is supposed to return an object and it fails. 1 Link to comment Share on other sites More sharing options...
fixthissite Posted January 20, 2015 Author Share Posted January 20, 2015 Why should it mention that? Well it's convention (similar to good identifier names). APIs should never force the client to assume things about it. Any well written documentation states these specifications. "returns null otherwise" or SOMETHING would be useful. It could return an empty array (which is actually recommended) for all I know Link to comment Share on other sites More sharing options...
Mysteryy Posted January 20, 2015 Share Posted January 20, 2015 Well it's convention (similar to good identifier names). APIs should never force the client to assume things about it. Any well written documentation states these specifications. "returns null otherwise" or SOMETHING would be useful. It could return an empty array (which is actually recommended) for all I know Fair enough. Im not disagreeing with you necessarily I am just saying it is a safe assumption if you are familiar with the api here. Where I work I write alot of code documentation, and I will always specify something like you stated, "otherwise returns null". For the scope of OSBot, its pretty safe to assume that it will be null though. ^_^ 3 Link to comment Share on other sites More sharing options...
fixthissite Posted January 20, 2015 Author Share Posted January 20, 2015 Fair enough. Im not disagreeing with you necessarily I am just saying it is a safe assumption if you are familiar with the api here. Where I work I write alot of code documentation, and I will always specify something like you stated, "otherwise returns null". For the scope of OSBot, its pretty safe to assume that it will be null though. That's the problem; I'm not familiar, which is why I asked for this. It would help out new people quite a bit as well, since they can quickly view the API and get an idea of what they're going to do. I'll keep that assumpsion for now on; thanks for the heads up Link to comment Share on other sites More sharing options...
Botre Posted January 28, 2015 Share Posted January 28, 2015 +1 Link to comment Share on other sites More sharing options...
Czar Posted January 28, 2015 Share Posted January 28, 2015 +11111111111111111111111 Link to comment Share on other sites More sharing options...