Jump to content

[Tutorial] Tribot 12 Gradle Script Project Setup


Recommended Posts

Hello Everyone,

Recently, I created a couple gradle project templates that can be used to start scripting with Tribot 12.

Features:

  • Automatically uses the latest tribot JAR. No config needed.
  • Has automated tasks for:
    • Compiling script to the .tribot/bin folder
    • Deleting the bin
    • Packaging your script as a .zip for repository upload
  • Has a run configuration for debugging your script in Tribot.

 

Prerequisites:

  • At least know what Gradle is
  • IntelliJ IDEA
  • An understand of how scripting for Tribot already works

 

Links:

 

Video:

Note: The error I got near the end of the video while building has since been fixed via the template

 

FAQ

Q: Can I add other gradle/maven dependencies from the internet?

A: No. Those dependencies will not get properly built or packaged correctly to run in Tribot

 

Q: Is this required to script for Tribot?

A. No, it's simply a convenience tool

  • Like 2
  • Thanks 6
Link to post
Share on other sites

Update:

  • The templates no longer explicitly have dependencies on included tribot libraries like "gson" and "guava". As of tribot 12.0.1-rc5, those dependencies are transitive, meaning the script gets them automatically.
  • I added allatori annotations to the templates so that you can use them in your scripts and so that DaxWalker compiles
Link to post
Share on other sites
1 hour ago, Lin09 said:

Hey, thanks for the guide. I followed the video but ran into this issue when first opening the project. What am I doing wrong?
image.thumb.png.177d2bf3979593b431aabb528d45aaaa.png

Hello,

The gradle plugin was built using Java JDK 15, so that's what it requires in order to use it.

 

However, I should have compiled it with a lower version so that it works for any JDK. I will fix this tomorrow. If you want to fix it sooner, use JDK 15 for development.

Link to post
Share on other sites
1 hour ago, Wastedbro said:

Hello,

The gradle plugin was built using Java JDK 15, so that's what it requires in order to use it.

 

However, I should have compiled it with a lower version so that it works for any JDK. I will fix this tomorrow. If you want to fix it sooner, use JDK 15 for development.

I'm using JDK 15 in the project structure and still getting this issue, unfortunately 

Link to post
Share on other sites
8 hours ago, Lin09 said:

I'm using JDK 15 in the project structure and still getting this issue, unfortunately 

IntelliJ will often default to your Java HOME variable for gradle, even if your project structure uses another version.

You can check by going to File > Settings > Build, Execution Deployment > Build Tools > Gradle and finding the option for Use Gradle From: and ensuring that is set to the same SDK as your project structure.

  • Like 1
Link to post
Share on other sites
  • 2 months later...

Sorry for bothering with perhaps a dumb question, but how would I go about adding daxwalker api to this structure? I really suck at the gradle ecosystem and cant figure out how to make my scripts see the library. I added the dax-api folder under libraries (see screenshot) and then added the include to settings.gradle.kts but my scripts still cant see the library functions. Perhaps its because they are one folder level deeper? I cant find where the build script is even defined to edit it myself.

0EkhjBr.png

Edited by Mursumarsu
Link to post
Share on other sites
  • 3 weeks later...
  • 1 month later...
  • 2 weeks later...
19 minutes ago, angelheartz said:

I've been using your template for a long time now and it's really nice! I've got one question regarding external libraries (I've read your FAQ). Is there a way to actually make external libraries work with this template? Or is it just impossible?

There's probably a way somehow but external libraries don't work for repo scripts so it's not something that I'm really going to look into to figure out.

Link to post
Share on other sites
  • 3 weeks later...
  • Encoded pinned this topic
  • 4 months later...
On 10/5/2021 at 10:57 AM, fatsquasher said:

I have issues regarding building the gradle as per the video.

Any advice?  

image.thumb.png.eaf29bdee2390d3be334b18b0bd9de1a.png

I had this same issue and found a fix on discord. This is needed for both the single script folder and multi script folder.

Credit to @Breaker as the first person I found posting it there:idea64_blY7Nu5YRx.png.3117301d47c00109608fb45af7b7eaf6.png

repositories

{
        jcenter()
        // Tribot Central
        maven {
            setUrl("https://gitlab.com/api/v4/projects/20741387/packages/maven")
        }
        maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
        google()

}

 

  • Thanks 1
Link to post
Share on other sites
  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Support for the gradle launcher is being dropped. Read more about the new launcher here.
        • Like
      • 8 replies
    • What to expect from TRiBot moving forward.
        • Thanks
        • Like
      • 11 replies
    • TRiBot 12 Release Candidate

      The TRiBot team has been hard at work creating the last major version of TRiBot before the TRiBot X release. We've noticed many problems with TRiBot 11 with a lot of users preferring TRiBot 10 over 11. We've heard you, so we took TRiBot 10, added the new features introduced with 11, introduced some other new things, and created TRiBot 12. So without further adieu, here's TRiBot 12.
        • Sad
        • Like
      • 40 replies
    • Gradle is a build tool used to accelerate developer productivity.

      We recently setup a Maven repository (TRiBot Central) to make it easier for scripters to create scripts. Check it out here: https://gitlab.com/trilez-software/tribot/tribot-central/-/packages

      Furthermore, we've released a simple Gradle project to make it easy to run TRiBot and develop scripts for it. Check it out here: https://gitlab.com/trilez-software/tribot/tribot-gradle-launcher

      The goals of TRiBot Central are to:

      Deliver updates to TRiBot faster


      Better organize TRiBot's dependencies (AKA dependancies)


      Make it easier to develop scripts for TRiBot


      Make it easier to use and run TRiBot


      Note: TRiBot won't be able to run scripts from within this project until TRiBot's next release.
        • Like
      • 13 replies
    • Hi everyone,

      I'd like to thank everyone for their patience in this transition period. Since last week, we've worked out the remaining bugs with this integration.

      Some users have still been having issues with connecting their forums account to their Auth0 account. To resolve this, we've imported all forums accounts into Auth0.

      Unfortunately, the accounts which were imported today were using an unsupported password hashing algorithm. Hence, random passwords were set during the import.

      What does this mean for me?

      If you've previously linked your forums account to your Auth0 account, you don't have to do anything. Nothing changes for you.


      If you haven't logged in via our new login yet,

      Try logging in with your forums email address and the last password you used


      If you are unable to login, please use the "Forgot password" tool on the login page:
      Follow the instructions to reset your password
       
        • thonking
        • Like
      • 17 replies
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...