Jump to content

High Alch Not Working.


Recommended Posts

Posted

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

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

Posted

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);
Posted (edited)
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
Posted (edited)
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
Posted
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 :)

 

Posted
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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...