September 27, 20187 yr Im still a noob in writing but how do you make it click into your magic tab, im trying to make a simple curse high lvl alch script
September 27, 20187 yr Author 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?
September 27, 20187 yr 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
September 27, 20187 yr Author 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
September 27, 20187 yr 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 September 27, 20187 yr by Spider
September 27, 20187 yr 16 minutes ago, kushad said: @Override magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY); } U need more Java
September 27, 20187 yr 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.
September 27, 20187 yr Author 2 minutes ago, Script Kid said: U need more Java haha i do just read the tutorial tonight decided try a simple script
September 27, 20187 yr 1 minute ago, FrostBug said: You should not perform interactions in onStart. Set up your script in onStart, execute your script in onLoop. Yeah I just saw he didn't have onloop in his methods and was using onStart so I didn't want to get into that now, thanks though
September 27, 20187 yr Perhaps follow some basic Java tutorials on the internet and after get yourself familiar with the API (https://osbot.org/api/), there you can find the methods you can use to script basically anything.
Create an account or sign in to comment