Jump to content

[Open Source] Sami Tele Alch


Samiofficial

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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