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.

High Alch Not Working.

Featured Replies

Hi Guys,

 

trying to get my high alcher script to work... here is code below.

 

Its getting to the right state get high alch selected then just hovers in inventory.... IF i pause script it then clicks once and alchs once! I am really confused I have tried a combination of interactions also tried

getInventory().getItem("Maple longbow").interact("Cast"); didnt work either... Please help pulling my hair out

 

if (currentState == State.HIGH_ALCH) {
    getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    new ConditionalSleep(random(30000, 100000)) {

        @Override
        public boolean condition() throws InterruptedException {
            return !getTabs().magic.isSpellSelected();
        }
    }.sleep();

    // sleep untill magic tab isnt open
    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);

2 hours ago, mcpimpen said:

 


if (currentState == State.HIGH_ALCH) {
    getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    new ConditionalSleep(random(30000, 100000)) {

        @Override
        public boolean condition() throws InterruptedException {
            return !getTabs().magic.isSpellSelected();
        }
    }.sleep();

    // sleep untill magic tab isnt open
    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);

You are sleeping for 30 to 100 seconds after you have selected the alch spell. Do a sleep until the inventory is visible, than interact with the item.

  • Author

Hi Bravo Taco,

 

cheers for reply.

the sleep is set so it doesnt start casting high alch again.. the issue I am having is its not interacting with the longbow at all as far as I am aware there is no code stopping that? I guess my question is does the below make sense? or is there a different way I should be selecting / interacting with the bows AFTER high alch has already been selected.

    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);
24 minutes ago, mcpimpen said:

Hi Bravo Taco,

 

cheers for reply.

the sleep is set so it doesnt start casting high alch again.. the issue I am having is its not interacting with the longbow at all as far as I am aware there is no code stopping that? I guess my question is does the below make sense? or is there a different way I should be selecting / interacting with the bows AFTER high alch has already been selected.






    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);

Also just tested your code, It is the sleep you are using causing the script to not interact with your inventory item.

This is what I tested.

getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
new ConditionalSleep(random(30000, 100000)) {
    @Override
    public boolean condition() throws InterruptedException {
        return !getTabs().magic.isSpellSelected();
    }
}.sleep();

// sleep untill magic tab isnt open
getInventory().interact("Cast", "Feather");

Than I removed the sleep.

getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
// sleep untill magic tab isnt open
getInventory().interact("Cast", "Feather");

This allowed it to work.

Also, It will work even with the sleep, but again it will take 30-100 seconds before it will interact with the item in the inventory.

Also you should use if statements on those calls so you can do other things based on if they were performed or not.

if (getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) {
    if (getInventory().interact("Cast", "Feather")) {
        // Do sleeps here
    }
}

Edited by BravoTaco

Didn't mean to repost this lol. Meant to edit the old one.

Edited by BravoTaco

3 hours ago, mcpimpen said:

Hi Bravo Taco,

 

cheers for reply.

the sleep is set so it doesnt start casting high alch again.. the issue I am having is its not interacting with the longbow at all as far as I am aware there is no code stopping that? I guess my question is does the below make sense? or is there a different way I should be selecting / interacting with the bows AFTER high alch has already been selected.



    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);

After interacting with the items just add another contional sleep to wait until it's back to magic tab ^^
You also have a small logic issue in your script, will make it pretty unstable :)
 

if (currentState == State.HIGH_ALCH) {
  if (s.getTabs().getOpen() == Tab.MAGIC) {
      if(getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)){
        new ConditionalSleep(2500) {
            @Override
            public boolean condition() throws InterruptedException {
                return s.getTabs().getOpen() == Tab.INVENTORY;
            }
        }.sleep();
      }
  }else{
      if(getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED)){
        new ConditionalSleep(2500) {
            @Override
            public boolean condition() throws InterruptedException {
                return s.getTabs().getOpen() == Tab.MAGIC;
            }
        }.sleep();
      }
   }
}

 

Edited by Khaleesi

  • Author
49 minutes ago, Khaleesi said:

After interacting with the items just add another contional sleep to wait until it's back to magic tab ^^
You also have a small logic issue in your script, will make it pretty unstable :)
 


if (currentState == State.HIGH_ALCH) {
  if (s.getTabs().getOpen() == Tab.MAGIC) {
      if(getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)){
        new ConditionalSleep(2500) {
            @Override
            public boolean condition() throws InterruptedException {
                return s.getTabs().getOpen() == Tab.INVENTORY;
            }
        }.sleep();
      }
  }else{
      if(getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED)){
        new ConditionalSleep(2500) {
            @Override
            public boolean condition() throws InterruptedException {
                return s.getTabs().getOpen() == Tab.MAGIC;
            }
        }.sleep();
      }
   }
}

 

Thanks Kahaleesi, Ill look at this in morning and rework... currently I had chnaged it to 

if (currentState == State.HIGH_ALCH) {
    getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);
    sleep(random(344,453));

Which works but obviously not best way around it.... I was previously using the tab method but kept getting a error when trying to == it to INVENTORY... 

 

I have very limited knowledge this is my first script so thanks for being patient... I am like 2 days into learning scripting / code.

 

Thanks :)

 

1 hour ago, mcpimpen said:

Thanks Kahaleesi, Ill look at this in morning and rework... currently I had chnaged it to 


if (currentState == State.HIGH_ALCH) {
    getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    getInventory().interact("Cast", MAPLE_LONG_BOW_ID_NOTED);
    sleep(random(344,453));

Which works but obviously not best way around it.... I was previously using the tab method but kept getting a error when trying to == it to INVENTORY... 

 

I have very limited knowledge this is my first script so thanks for being patient... I am like 2 days into learning scripting / code.

 

Thanks :)

 

Well you learn by doing it 😉

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.