Jump to content

Getting into the magic tab?


kushad

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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.

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