Jump to content

[Open Source] Sami Tele Alch


Recommended Posts

Posted (edited)

Screenshot-2024-09-10-141156.png


Sami Tele Alch

import org.osbot.rs07.api.ui.Spells;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.model.Item;
import org.osbot.rs07.utility.ConditionalSleep;

@ScriptManifest(name = "Sami Tele Alch", author = "Sami", version = 1.0, info = "", logo = "")
public class Main extends Script {

    private static final int NATURE_RUNE = 561;
    private static final int FIRE_RUNE = 554;
    private static final int ITEM_TO_ALCH = 892;

    @Override
    public void onStart() {
        log("Sami Tele Alch Script Started");
    }

    @Override
    public int onLoop() throws InterruptedException {

        if(!myPlayer().isAnimating()) {
            if (getMagic().canCast(Spells.NormalSpells.CAMELOT_TELEPORT)) {
                getMagic().castSpell(Spells.NormalSpells.CAMELOT_TELEPORT);
                sleep(300);
            }
        }
        
        if (canAlch()) {
            if (getMagic().castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY)) {
                sleep(300);
                new ConditionalSleep(5000){
                    @Override
                    public boolean condition() {
                        return myPlayer().getAnimation() == -1;
                    }
                }.sleep();
                Item item = getInventory().getItem(ITEM_TO_ALCH);
                if (item != null) {
                    item.interact("Cast");
                }
            }
        }
        
        return 600;
    }

    private boolean canAlch() {
        return getInventory().contains(NATURE_RUNE) && (getInventory().contains(FIRE_RUNE) || isUsingFireStaff()) && getInventory().contains(ITEM_TO_ALCH);
    }

    private boolean isUsingFireStaff() {
        return getEquipment().isWieldingWeaponThatContains("Staff of fire");
    }

    @Override
    public void onExit() {
        log("Sami Tele Alch Script Stopped");
    }
}

 

image.png

Edited by Samiofficial

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...