This script will alch any item in inventory and log out if no nature runes . It has a 5% chance to open the skills tab a small anti ban precaution. If you test this or use it please comment to let me know!
import org.dreambot.api.methods.Calculations;
import org.dreambot.api.methods.container.impl.Inventory;
import org.dreambot.api.methods.magic.Normal;
import org.dreambot.api.methods.magic.Magic;
import org.dreambot.api.methods.skills.Skills;
import org.dreambot.api.methods.tabs.Tabs;
import org.dreambot.api.script.AbstractScript;
import org.dreambot.api.script.Category;
import org.dreambot.api.script.ScriptManifest;
import org.dreambot.api.wrappers.items.Item;
import java.util.List;
import java.util.Random;
@ScriptManifest(category = Category.MAGIC, image = "", name = " NK ALCHEMIZE", author = "NotKashez", description = "Alchemize me captain", version = 1.0)
public class Main extends AbstractScript {
private Random rand = new Random();
@Override
public int onLoop() {
highAlchItems();
return Calculations.random(600, 800); // Sleep for a random period between 600 and 800 milliseconds
}
private void highAlchItems() {
List<Item> items = Inventory.all();
// Check for Nature runes in the inventory
Item natureRune = Inventory.get("Nature rune");
if (natureRune == null) {
log("No Nature runes in inventory. Logging out...");
Tabs.logout();
stop();
return;
}
for (Item item : items) {
// Add a null check for the item
if (item != null) {
String itemName = item.getName();
if (!itemName.equals("Nature rune") && !itemName.equals("Coins")) {
sleep(Calculations.random(1000, 1500));
Magic.castSpell(Normal.HIGH_LEVEL_ALCHEMY);
sleep(Calculations.random(1500, 2000));
item.interact();
if (rand.nextInt(100) < 5) {
Skills.open();
sleep(1000,2000);
}
break;
}
}
}
}