Jump to content

Getting into the magic tab?


Recommended Posts

Posted
1 hour ago, FrostBug said:

getTabs().open(Tab.MAGIC);

 

thanks man, how do i say like click after tab magic curse mouse position mouse x 666.0 mouse y255.0 then on like a object then to high lvl alch  mouse x 715.0 mouse y 327.0 

is it best to use mouse positions to perform magic spells or is there a better way?

Posted
13 minutes ago, kushad said:

thanks man, how do i say like click after tab magic curse mouse position mouse x 666.0 mouse y255.0 then on like a object then to high lvl alch  mouse x 715.0 mouse y 327.0 

is it best to use mouse positions to perform magic spells or is there a better way?

What you're looking for is 

    magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);

this will also open the magic tab automatically

Posted
2 minutes ago, Spider said:

What you're looking for is 


    magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);

this will also open the magic tab automatically

package core;

import java.awt.Graphics2D;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Kushad", info = "My first script", name = "CurseAlcher", version = 0, logo = "")
public class Main extends Script {

    @Override
    public void onStart() {
        log("Let's get started!");
    }

    @Override
    magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    
    }


    @Override
    public void onExit() {
        log("Thanks for running my Curse Alcher!");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

 

comes up with red lines

Posted (edited)
11 minutes ago, kushad said:

package core;

import java.awt.Graphics2D;

import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Kushad", info = "My first script", name = "CurseAlcher", version = 0, logo = "")
public class Main extends Script {

    @Override
    public void onStart() {
        log("Let's get started!");
    }

    @Override
    magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
    
    }


    @Override
    public void onExit() {
        log("Thanks for running my Curse Alcher!");
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

 

comes up with red lines

That's because you need to put that code inside the onstart or onloop function 

What you want to do is this

   public void onStart() {
        
        magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); 
        getInventory().getItemInSlot(0).interact("Cast"); // to alch item in slot 0 for example

    }

I also suggest learning java before trying to get into scripting it will make your life a lot easier ^_^

Edited by Spider
Posted
14 minutes ago, Spider said:

That's because you need to put that code inside the onstart or onloop function 

What you want to do is this


   public void onStart() {
        
        magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); 
        getInventory().getItemInSlot(0).interact("Cast"); // to alch item in slot 0 for example

    }

I also suggest learning java before trying to get into scripting it will make your life a lot easier ^_^

You should not perform interactions in onStart. Set up your script in onStart, execute your script in onLoop.

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