Spork Posted December 31, 2016 Share Posted December 31, 2016 So hey OSBot, even though I'll probably get called a leecher like I was in my last thread lol, I'm having another issue. I've finished my cowhide script, and it's pretty efficient. Fills an inventory in about 2 mins (~100k/hr profit), but I want to record how many of the hides I've actually picked up.My paint includes the time ran, but I want to know how many hides I've looted in that time. How do I know if I actually picked that hide up, since 1 out of 3 hides my script goes after are looted by other people. Any ideas? Quote Link to comment Share on other sites More sharing options...
Fratem Posted December 31, 2016 Share Posted December 31, 2016 Haven't written a script here before; But can't you add something along this, count how many cowhides in inventory at start; and iterate it whenever you call your pickup method and it's sucessfull +1? 1 Quote Link to comment Share on other sites More sharing options...
Temsei Posted December 31, 2016 Share Posted December 31, 2016 http://osbot.org/forum/topic/88542-how-to-track-how-much-i-picked-up-of-one-specific-item/ Google's a friend 1 Quote Link to comment Share on other sites More sharing options...
Spork Posted December 31, 2016 Author Share Posted December 31, 2016 Haven't written a script here before; But can't you add something along this, count how many cowhides in inventory at start; and iterate it whenever you call your pickup method and it's sucessfull +1? This is what I intended on doing, but I wasn't sure if it was the best way, or even the most accurate. Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 31, 2016 Share Posted December 31, 2016 (edited) Haven't written a script here before; But can't you add something along this, count how many cowhides in inventory at start; and iterate it whenever you call your pickup method and it's sucessfull +1? Edit: Nevermind! Edited December 31, 2016 by Apaec 1 Quote Link to comment Share on other sites More sharing options...
Fratem Posted December 31, 2016 Share Posted December 31, 2016 Not really, as sometimes pickup fails leaving the counter incremented without actually collecting another cowhide @OP if you want a super simple way, you can make a counter and add 28 to it every time you bank. If you want to do it properly, you're going to need to, when picking up an item, check that it is added to your inventory, and only then can you increment a counter. Yeah that's what I meant with being sucessfully picked up, so he'll have to add failsafe/checks if the script looted the cowhide & shows in inventory. 1 Quote Link to comment Share on other sites More sharing options...
Xerifos Posted December 31, 2016 Share Posted December 31, 2016 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. Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 31, 2016 Share Posted December 31, 2016 (edited) So hey OSBot, even though I'll probably get called a leecher like I was in my last thread lol, I'm having another issue. I've finished my cowhide script, and it's pretty efficient. Fills an inventory in about 2 mins (~100k/hr profit), but I want to record how many of the hides I've actually picked up. My paint includes the time ran, but I want to know how many hides I've looted in that time. How do I know if I actually picked that hide up, since 1 out of 3 hides my script goes after are looted by other people. Any ideas? firstly, this isn't a tutorial. next time, post in scripting help. secondly, GroundItem foundHide = groundItems.closest("Cowhide"); if(foundHide != null) { long pastHide = inventory.getAmount("Cowhide"); if(foundHide.interact("Take")) { new ConditionalSleep(5000) { @ Override public boolean condition() throws InterruptedException { return !foundHide.exists(); } }.sleep(); if(inventory.getAmount("Cowhide") > pastHide) { paintCounter++; } } } Edited December 31, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
Xerifos Posted December 31, 2016 Share Posted December 31, 2016 firstly, this isn't a tutorial. next time, post in scripting help. secondly, GroundItem foundHide = groundItems.closest("Cowhide"); if(foundHide != null) { long pastHide = inventory.getAmount("Cowhide"); if(foundHide.interact("Take")) { new ConditionalSleep(5000) { @ Override public boolean condition() throws InterruptedException { return inventory.getAmount("Cowhide") > pastHide; } }.sleep(); if(inventory.getAmount("Cowhide") > pastHide) { paintCounter++; } } } This would make him sleep even if he did not pick it up. It would be better to make a conditional on when the grounditem isn't visible anymore. 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 31, 2016 Share Posted December 31, 2016 Yeah that's what I meant with being sucessfully picked up, so he'll have to add failsafe/checks if the script looted the cowhide & shows in inventory. Sorry, I misread what you initially posted as just incrementing a counter when calling the pick up statement... Apologies! 1 Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 31, 2016 Share Posted December 31, 2016 This would make him sleep even if he did not pick it up. It would be better to make a conditional on when the grounditem isn't visible anymore. good catch. would probably take it a step further and just say !foundHide.exists() 1 Quote Link to comment Share on other sites More sharing options...
Spork Posted December 31, 2016 Author Share Posted December 31, 2016 Yo guys, I solved it. Thank you all, sorry I posted in the wrong section by the way, I misunderstood the description of this board. :P Finished my script finally! Quote Link to comment Share on other sites More sharing options...
Xerifos Posted December 31, 2016 Share Posted December 31, 2016 Yo guys, I solved it. Thank you all, sorry I posted in the wrong section by the way, I misunderstood the description of this board. :P Finished my script finally! Goodluck on your next scripts Quote Link to comment Share on other sites More sharing options...