Sumo Posted January 27, 2016 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
Vilius Posted January 27, 2016 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
Sumo Posted January 27, 2016 Author 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!
Apaec Posted January 27, 2016 Posted January 27, 2016 Awesome mate! I love the way you say 'juicy' ~apa 1
Animos Posted January 27, 2016 Posted January 27, 2016 (edited) Thank you! Appreciate it. Subbed. Edited January 27, 2016 by Animos