Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to know if I picked the item up?

Featured Replies

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?

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?

  • 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.

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 by Apaec

Not really, as sometimes pickup fails leaving the counter incremented without actually collecting another cowhide smile.png

 

@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.

 

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.

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 by Imateamcape

 

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. 

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!

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()

  • 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!

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.