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.

Strange issue making pie shells

Featured Replies

I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells.

 

script.inventory.getItem("Pie dish").interact("Use");
Script.sleep(Script.random(2000, 3000));
script.inventory.getItem("Pastry dough").interact("Use");
Script.sleep(Script.random(800, 1500));
script.log("debug 1");

It never gets to writing to the log (or any other action I put there).

 

Any idea what I am doing wrong?

 

 

if !item selected {

select item

} else {

interact item 2

}

  • Author
1 minute ago, raijin said:

interact item1

if inventory.isitemselected

interact item 2

 

try that

I should have added that the second interact is definitely working, the "How many would you like to make?" window appears.

 

But after that nothing, the debug never shows in the log it just waits till the next loop and starts the interacts again.

16 minutes ago, sudoinit6 said:

I should have added that the second interact is definitely working, the "How many would you like to make?" window appears.

 

But after that nothing, the debug never shows in the log it just waits till the next loop and starts the interacts again.

dont u gotta like, make it do the window

Try and write your script such that they are never relying on a method to execute correctly - as you're writing scripts for a live game, issues like latency drops and disconnects mean you can never fully rely on a method to correctly execute fully every time. To combat this, try and make your script more conditional, i.e if this then do that etc. Hopefully then it will be easier to debug :)

 

On 4/22/2017 at 6:23 PM, sudoinit6 said:

I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells.

 

script.inventory.getItem("Pie dish").interact("Use");
Script.sleep(Script.random(2000, 3000));
script.inventory.getItem("Pastry dough").interact("Use");
Script.sleep(Script.random(800, 1500));
script.log("debug 1");

It never gets to writing to the log (or any other action I put there).

 

Any idea what I am doing wrong?

 

 

Your script isn't sleeping as far as I can tell,  even though it shouldn't matter because InteractionEvent takes care of that for you. Although it doesn't solve your issue, make Script.sleep -> script.sleep.

On 4/22/2017 at 11:23 PM, sudoinit6 said:

I have used this syntax before but for some reason this isn't working. It never gets beyond the second interact and then it loops back and starts again never making any shells.

 

script.inventory.getItem("Pie dish").interact("Use");
Script.sleep(Script.random(2000, 3000));
script.inventory.getItem("Pastry dough").interact("Use");
Script.sleep(Script.random(800, 1500));
script.log("debug 1");

It never gets to writing to the log (or any other action I put there).

 

Any idea what I am doing wrong?

 

 

What I would do is start by structuring your script so that if an event fails at anytime, it will simply retry that action only, not the whole loop again (as @Apaec suggested):

if (!inventory.isItemSelected()) {
    // Use first item
    // Sleep until inventory.isSelected()
} else {
    // Use first item with second item
    // Sleep until finished making pie shell
}

Here is a full example taken from my AIO Herblore script:

if (!script.inventory.isItemSelected()) {
    Item pestle = script.inventory.getItem("Pestle and mortar");
    if (pestle != null) {
        if (pestle.interact("Use")) {
            Sleep.sleepUntil(() -> script.inventory.isItemSelected(), 5000);
        }
    }
} else {
    int clickSlot = script.inventory.getSlot(itemToGrind);
    InventorySlotDestination itemSlot = new InventorySlotDestination(script.getBot(), clickSlot);
    script.getMouse().move(itemSlot);
    if (script.getMouse().click(false)) {
        Sleep.sleepUntil(() -> !script.inventory.contains(itemToGrind) || script.getDialogues().isPendingContinuation(), 120000);
    }
}

 

Edited by harrypotter

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.