Jump to content

Need help with casting a spell


Recommended Posts

Posted (edited)

Th is is my current code:

 

package wineripper;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.api.ui.Spells;

import java.awt.*;

@ScriptManifest(name = "Winegrabber", author = "Dalukas", version = 1.0, info = "", logo = "")
public class Wineripper extends Script {
	public static final Spells.NormalSpells TELEKINETIC_GRAB = null;
	public String WINE_NAME = "Wine of zamorak";

	@Override
	public void onStart() {
		// Code here will execute before the loop is started

	}

	@Override
	public void onExit() {
		// Code here will execute after the script ends

	}

	@Override
	public int onLoop() throws InterruptedException {
		Inventory inven = getInventory();
		if (!inven.isFull()) {
			Entity wine = getObjects().closestThatContains(WINE_NAME);
			magic.castSpellOnEntity(TELEKINETIC_GRAB, wine);

		}

		return 100;

	}

	@Override
	public void onPaint(Graphics2D g) {
		// Paint

	}

}

Edited by dalukas

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...