Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Writing script, Help with (get Equipment)


    frute
     Share

    Recommended Posts

    I am writing a mining script and all the tutorials say to use 

     

    "if(!getInventory().contains(pickaxe)){

    Item weapon = getEquipment().getItemInSlot(getEquipment()) "

     

    But it says "(getEquipment)" is invalid and I don't know what to do. 

    Is there another method or way i should use?

    Edited by frute
    Link to comment
    Share on other sites

    I am writing a mining script and all the tutorials say to use 

     

    "if(!getInventory().contains(pickaxe)){

    Item weapon = getEquipment().getItemInSlot(getEquipment()) "

     

    But it says "(getEquipment)" is invalid and I don't know what to do. 

    Is there another method or way i should use?

    if(!getInventory().equals().getNameContains("pickaxe")) {

    //CODE

    }

     

    (It is close to that, this may not be exactly the line I cannot check currently

    Link to comment
    Share on other sites

    I tried both methods suggested and neither of them worked, they both gave me the same issue.

    Even that says it cannot be applied to

     

    import org.dreambot.api.methods.container.impl.equipment.Equipment;

    or 

    import org.dreambot.api.methods.container.impl.equipment.EquipmentSlot;

    Link to comment
    Share on other sites

    I tried both methods suggested and neither of them worked, they both gave me the same issue.

    Even that says it cannot be applied to

     

    import org.dreambot.api.methods.container.impl.equipment.Equipment;

    or 

    import org.dreambot.api.methods.container.impl.equipment.EquipmentSlot;

    Try it your way:

     

    Item pickaxe = getInventory().getName().contains("pickaxe") //GOT it right that time

    if(pickaxe !=null) {

    if(!getInventory().contains(pickaxe) || !getEquipment.contains(pickaxe)) {

    //CODE

    }

    }

    Link to comment
    Share on other sites

    frute, on 15 Nov 2016 - 3:47 PM, said:

    I am writing a mining script and all the tutorials say to use

     

    "if(!getInventory().contains(pickaxe)){

    Item weapon = getEquipment().getItemInSlot(getEquipment()) "

     

    But it says "(getEquipment)" is invalid and I don't know what to do.

    Is there another method or way i should use?

    Item pickaxe = getEquipment().get(f -> f!=null && f.getName().contains("pickaxe"));

     

    if (pickaxe !=null){

    mine rocks

    }

    else if (getInventory().contains(f -> f!=null && f.getName().contains("pickaxe"))){

    getInventory().get(f -> f!=null && f.getName().contains("pickaxe")).interact("Wield");

    sleepuntil equipped

     

    }

    Edited by none
    Link to comment
    Share on other sites

    .

    I forgot null check :P also he is still reading tutorials so the easier the better

     

     

    Also any reason your a Scripter+ scripter? lol?

    Edited by triblion
    Link to comment
    Share on other sites

    I forgot null check :P also he is still reading tutorials so the easier the better

     

     

    Also any reason your a Scripter+ scripter? lol?

    was modifying my post :P thats why it was a . , and im both cause it looks awesome :P

    Link to comment
    Share on other sites

    was modifying my post :P thats why it was a . , and im both cause it looks awesome :P

    TBF looks pretty cool :P also what difference does putting f -> f do? Or was the main difference I forgot a null check :P

    Link to comment
    Share on other sites

    TBF looks pretty cool :P also what difference does putting f -> f do? Or was the main difference I forgot a null check :P

    its a filter

    TBF looks pretty cool :P also what difference does putting f -> f do? Or was the main difference I forgot a null check :P

    your looking to see if your inventory name contains pickaxe instead of checking if the inventory conains an item with the name pickaxe

    Link to comment
    Share on other sites

     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.