GoldenGates Posted March 9, 2016 Share Posted March 9, 2016 package trumpbitch; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import trumpbitch.Woodcutting; @ScriptManifest(name = "trumpscape", author = "trump", version = 6.9, info = "trump", logo = "trump") public class Main extends Script { @Override public void onStart() { // nothing cause trump } @Override public int onLoop() { Woodcutting.cutTree(this); return 100; } } package trumpbitch; import org.osbot.rs07.script.Script; public class Woodcutting { public void cutTree(Script script) { script.log("trump for pres"); // insert just the tip } } this way is pretty much the same thing but i find it's easier to copy paste to new scripts this way. good luck It's not a good idea to have multiple instances of Script, just keep it a subclass of the Main or if you use Nodes, use your Main's superclass (that certain Script instance) as the Script instance for your other class. 1 Quote Link to comment Share on other sites More sharing options...
nyan Posted March 9, 2016 Share Posted March 9, 2016 It's not a good idea to have multiple instances of Script, just keep it a subclass of the Main or if you use Nodes, use your Main's superclass (that certain Script instance) as the Script instance for your other class. Why is it a bad idea? I haven't had an issue with it yet. Quote Link to comment Share on other sites More sharing options...
GoldenGates Posted March 9, 2016 Share Posted March 9, 2016 Why is it a bad idea? I haven't had an issue with it yet. Script is a type of instance that should only be done once. It's very unlikely to run into problems since we're not dealing with anything that will cause that but think of it this way. When you make a class for methods that needs Script, you're not going to inherit a brand new instance of what your main class has, you want something to 'show' that it's not the main class, hence using the main class' Script instance or using your main class itself. It's 7am and I haven't slept so I may not be explaining it properly, if someone can pitch in that would help. Quote Link to comment Share on other sites More sharing options...
nyan Posted March 9, 2016 Share Posted March 9, 2016 (edited) Script is a type of instance that should only be done once. It's very unlikely to run into problems since we're not dealing with anything that will cause that but think of it this way. When you make a class for methods that needs Script, you're not going to inherit a brand new instance of what your main class has, you want something to 'show' that it's not the main class, hence using the main class' Script instance or using your main class itself. It's 7am and I haven't slept so I may not be explaining it properly, if someone can pitch in that would help. I thought the method I was using was just using the Script class inherited in the main class (extends Script). The Scripts in the other classes are only used as parameters and aren't other instances? Edited March 9, 2016 by Shiny Quote Link to comment Share on other sites More sharing options...
GoldenGates Posted March 9, 2016 Share Posted March 9, 2016 I thought the method I was using was just using the Script class inherited in the main class (extends Script). The Scripts in the other classes are only used as parameters and aren't other instances? In other classes they're almost always initiated from your main class, for example you have a node that passes a Script parameter. So you do Banking banking = new Banking(this); This refers to the superclass of the class you call it in (the main class) so the superclass is (Script). Am I making sense rn? Quote Link to comment Share on other sites More sharing options...
Deceiver Posted March 9, 2016 Share Posted March 9, 2016 master coder u Quote Link to comment Share on other sites More sharing options...
Chicken Wing Posted March 9, 2016 Share Posted March 9, 2016 Watch this video, and some others if you want from the playlist Quote Link to comment Share on other sites More sharing options...
Bitshift Posted March 10, 2016 Share Posted March 10, 2016 (edited) Well, it's a good thing I have this here thread for that there point you're making. And 'one of'. Saying I know about Java doesn't necessarily imply I can list every single function and know exactly what to do in every situation without outside assistance either. Regardless of what knowledge you have on the topic, you don't understand something until all of the common factors are understood together. Without that, you are literally just putting pieces together, hoping it turns out right. Also, one of my previous posts was intended to expand on information already provided to you. With that being said, I have no reason to insist your level of programming in this case. Edited March 12, 2016 by Bitshift Quote Link to comment Share on other sites More sharing options...