Hashtag 8688 Share Posted February 16, 2017 Paint All about making the brilliant paint. (I wrote this section at 2am, please bear with me) First of all, add this method in your script. All the example code below should be written inside this method. Getting coordinates Setting color Setting font Drawing text Drawing rectangles Drawing an image Drawing an in game tile The final product and full source GUI IMPORTANT FOR DB3 SUPPORT: Replace the createGUI() method call with SwingUtilities.invokeLater(() => createGUI()); Nearly all scripts have some kind of a GUI. GUI is the window that appears when you start a script. You input all kinds of info, such as which enemy to attack and should your bot use prayer or not. Now we will take a look at creating a GUI ourselves. We will not be using any kind of a form maker program. Creating a GUI can be sometimes very tedious, especially when you write it completely yourself without the use of a form maker. I personally use WindowBuilder, a plugin for Eclipse. It saves me a lot of time when making a GUI. Starting off The createGUI method Adding different components The final product and full source AbstractScript versus TaskScript Let's take a peek at the differences between AbstractScript and TaskScript. I have written a basic powerchopper script in both frameworks and the sources are visible in the spoilers below. Both of the scripts work the same way. Chops trees until inventory is full and then drops them. AbstractScript source TaskScript source Okay, okay, I've seen enough code. Now what are the differences? As I said the scripts work exactly the same way. However, some scripters, like me, prefer to use the TaskScript framework. Why is that? Well... mostly because your code is spread in to different classes which makes it easier for you to modify your code. You also get the opportunity to set priorities to your nodes and understanding which piece of code is ran is easier. Of course this example script is very basic and short which makes the use of TaskScript an overkill. It is better to use AbstractScript on small scripts using either if-framework or state-framework. Feel free to request new tutorials. If you have any questions, do not hesitate to ask! MattchuPicchu, flipjazz, Donald Trump and 23 others 10 16 Link to comment Share on other sites More sharing options...
Donald Trump 333 Share Posted February 16, 2017 What other tutorial are coming soon. Link to comment Share on other sites More sharing options...
Hashtag 8688 Author Share Posted February 16, 2017 What other tutorial are coming soon. I saw someone asking tutorial on using TaskScript on Discord chat so I decided to start with this. In the future I will create tutorials on the basic stuff such as how to interact with different objects in game and doing other cool stuff such as gui and paint. All ideas are welcome and I'll try my best to create a tutorial for it! =) Link to comment Share on other sites More sharing options...
Im A Baller 348 Share Posted February 16, 2017 Looks good. Hashtag 1 Link to comment Share on other sites More sharing options...
Soldtodie 76 Share Posted February 16, 2017 Abstract for the win! Hashtag and Volta 2 Link to comment Share on other sites More sharing options...
Hashtag 8688 Author Share Posted February 17, 2017 Added paint tutorial. Link to comment Share on other sites More sharing options...
Pandemic 2702 Share Posted February 17, 2017 Nice tutorials Hashtag 1 Link to comment Share on other sites More sharing options...
Hashtag 8688 Author Share Posted February 18, 2017 Added GUI tutorial. Link to comment Share on other sites More sharing options...
Nex 2542 Share Posted February 19, 2017 GUI looks usefull tnx Hashtag 1 Link to comment Share on other sites More sharing options...
MattchuPicchu 6 Share Posted February 19, 2017 Nice Hashtag 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now