December 31, 20169 yr 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?
December 31, 20169 yr 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?
December 31, 20169 yr http://osbot.org/forum/topic/88542-how-to-track-how-much-i-picked-up-of-one-specific-item/ Google's a friend
December 31, 20169 yr Author 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.
December 31, 20169 yr 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, 20169 yr by Apaec
December 31, 20169 yr 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.
December 31, 20169 yr 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.
December 31, 20169 yr 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, 20169 yr by Imateamcape
December 31, 20169 yr 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.
December 31, 20169 yr 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!
December 31, 20169 yr 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()
December 31, 20169 yr Author 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!
December 31, 20169 yr 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
Create an account or sign in to comment