frute 0 Share Posted November 15, 2016 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? Link to comment Share on other sites More sharing options...
Pandemic 2702 Share Posted November 15, 2016 getEquipment().getItemInSlot(EquipmentSlot.WEAPON) Link to comment Share on other sites More sharing options...
triblion 56 Share Posted November 15, 2016 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 More sharing options...
frute 0 Author Share Posted November 15, 2016 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 More sharing options...
triblion 56 Share Posted November 15, 2016 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 More sharing options...
None 227 Share Posted November 15, 2016 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 } Link to comment Share on other sites More sharing options...
triblion 56 Share Posted November 15, 2016 . I forgot null check also he is still reading tutorials so the easier the better Also any reason your a Scripter+ scripter? lol? Link to comment Share on other sites More sharing options...
None 227 Share Posted November 15, 2016 I forgot null check also he is still reading tutorials so the easier the better Also any reason your a Scripter+ scripter? lol? was modifying my post thats why it was a . , and im both cause it looks awesome Link to comment Share on other sites More sharing options...
triblion 56 Share Posted November 15, 2016 was modifying my post thats why it was a . , and im both cause it looks awesome TBF looks pretty cool also what difference does putting f -> f do? Or was the main difference I forgot a null check Link to comment Share on other sites More sharing options...
None 227 Share Posted November 15, 2016 TBF looks pretty cool also what difference does putting f -> f do? Or was the main difference I forgot a null check its a filter TBF looks pretty cool also what difference does putting f -> f do? Or was the main difference I forgot a null check 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.