frute 0 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?
triblion 56 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
frute 0 Author 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;
triblion 56 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 } }
None 227 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 }
triblion 56 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?
None 227 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
triblion 56 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
None 227 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.