import org.osbot.script.Script;
import org.osbot.script.rs2.ui.Inventory;
public class Snipets {
Script script;
public boolean drinkBestPot(String type) throws Exception{
Inventory inv = script.client.getInventory();
String potName;
if(inv.contains("Extreme "+type+" (1)"))
potName = "Extreme "+type+" (1)";
else
if(inv.contains("Extreme "+type+" (2)"))
potName = "Extreme "+type+" (2)";
else
if(inv.contains("Extreme "+type+" (3)"))
potName = "Extreme "+type+" (3)";
else
if(inv.contains("Extreme "+type+" (4)"))
potName = "Extreme "+type+" (4)";
else
if(inv.contains("Super "+type+" (1)"))
potName = "Super "+type+" (1)";
else
if(inv.contains("Super "+type+" (2)"))
potName = "Super "+type+" (2)";
else
if(inv.contains("Super "+type+" (3)"))
potName = "Super "+type+" (3)";
else
if(inv.contains("Super "+type+" (4)"))
potName = "Super "+type+" (4)";
else
if(inv.contains(type+" potion (1)"))
potName = type+" potion (1)";
else
if(inv.contains(type+" potion (2)"))
potName = type+" potion (2)";
else
if(inv.contains(type+" potion (3)"))
potName = type+" potion (3)";
else
if(inv.contains(type+" potion (4)"))
potName = type+" potion (4)";
else
return false;
return inv.interactWithName(potName, "Drink");
}
}
Because code optimization is for pussies...
Wow people thought I was serious