Sumo Posted January 27, 2016 Share Posted January 27, 2016 (edited) This guide is basically for you who never created a script before, I want to show you that its possible to create a simple script without almost no Java knowledge at all. Basically I just want to introduce more people into scripting. First video: Alright so my name is William and I've been playing around with Java and OSBots api for some months now. I feel that teaching is one of the best ways of learning so thats why I am creating this guide. I will try to upload atleast 1-2 clips per day and as soon as I am done with the "Create your first script" Series I will create a new series where Ill teach you how to "improve" your script, add a GUI, add some cool paint and much more. As I am fairly new to scripting, you ( who are experienced) probably have better solutions than I do, please share them with us! I would be great if you could leave a comment (in the youtube video) with some suggestion. Dont just comment ("you suck"), tell me what I can do better! Thank you for reading this and I really hope you will learn something! Please watch the video on youtube so you can also leave a comment or just drop a like if you feel that you learned something! Edited January 27, 2016 by Sumo 3 Quote Link to comment Share on other sites More sharing options...
Realist Posted January 27, 2016 Share Posted January 27, 2016 nice of you to make this man 1 Quote Link to comment Share on other sites More sharing options...
Vilius Posted January 27, 2016 Share Posted January 27, 2016 (edited) "with no java knowledge at all" so basically you are encouraging skidding, right? Plus, fairly bad code design you are showing for the plebs You could have done: public abstract class Task{ protected Script script; public Task(Script script){ this.script = script; } public abstract boolean active(); public abstract void execute(); public void run(){ if (active()) execute(); } } and just in the main class did: public int onLoop(){ tasks.forEach(task -> task.run()); return 100; } Edited January 27, 2016 by Vilius 1 Quote Link to comment Share on other sites More sharing options...
Sumo Posted January 27, 2016 Author Share Posted January 27, 2016 "with no java knowledge at all" so basically you are encouraging skidding, right? Plus, fairly bad code design you are showing for the plebs You could have done: public abstract class Task{ protected Main script; public Task(Main script){ this.script = script; } public abstract boolean active(); public abstract void execute(); public void run(){ if (active()) execute(); } } and just in the main class did: public int onLoop(){ tasks.forEach(task -> task.run()); return 100; } Brilliant! Thats the type of feedback im looking for, thank you very much! Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 27, 2016 Share Posted January 27, 2016 Awesome mate! I love the way you say 'juicy' ~apa 1 Quote Link to comment Share on other sites More sharing options...
Animos Posted January 27, 2016 Share Posted January 27, 2016 (edited) Thank you! Appreciate it. Subbed. Edited January 27, 2016 by Animos Quote Link to comment Share on other sites More sharing options...