Tutorial [2020] Setting up IntelliJ

Discussion in 'Tutorials & Resources' started by Michaud.retard, Aug 16, 2020.

  1. Michaud.retard

    Joined:
    Sep 14, 2019
    Messages:
    18
    Likes Received:
    9
    • Either click here or search 'intellij' on Google (and select the first result) in order to download IntelliJ. On the download page, select the Community Edition.

    • When the IntelliJ download is finished, you can go ahead and install it - no special configuration is needed here.

    • The 'Customize Idea' screen will show up. Select any options you want, or alternatively, click 'Skip All and Set Defaults'

    • Select "Create New Project"

    • In the "New project" window, you'll need to pick the project SDK.
      1. Click on the project SDK bar and select the option "Download JDK".
      2. In the "Download JDK" window, click on the vendor bar and select "Amazon Corretto".
      3. Click on the version bar and select "1.8.0_265" then click the download button.
      4. Click "Next", and keep doing so until you reach the "Project name" textbox. I called my project Runemate, but you can call it whatever you want.

    • Take note of the project location. Next, take the RuneMate.jar file which you downloaded earlier, and Copy & Paste it into the Project location directory.

    • Press "Ctrl+Alt+Shift+S" to open the project structure.
      1. In project setting select "Modules".
      2. Click on the "Dependencies" tab.
      3. On the right side of the panel click the + button and select "JARs or directories"
      4. In the "Attach Files or Directories" go to the location where you installed RuneMate and select “RuneMate.jar”.
      5. Click on the "OK" button.

    • On the main IntelliJ window, select Run -> Edit Configurations.

    • On the dialogue which appears, click the "+" button, and select "Application"
      1. In the "Name" field choose the name of the application. Mine is "Spectre".
      2. In the "Main class" field copy paste
      Code (Text):
      1. com.runemate.boot.Boot
      3. In the "Program arguments" field copy and paste.
      Code (Text):
      1. -sdk -login=usename:password
      (Replace the "username" and "password" by your forum username and your password)
      4. Click the JRE bar and go to your RuneMate location and select the “jre” folder.
      (The default path should be)
      Code (Text):
      1. C:\Program Files (x86)\RuneMate\jre
      5. Click the "OK" button.

    • If the project sidebar is not open press "Alt+1".
      1. Right click the "src" folder --> New --> Package
      2. Name your package as follow "com.username.scripts bots"
      (Replace "username" by your username)
      3. Right click the project bar then Compact Middle Packages.
      4. Right click the "scripts bots" folder --> New --> Package. Name the package "test".

    • In the new package name "test" create a Java Class named "test" and a new File named "test.manifest.xml".

    • In the xml file copy and paste this code
      Code (Text):
      1.  
      2. <manifest>
      3.     <main-class>com.username.scripts.test.test</main-class>
      4.     <name>Test</name>
      5.     <description>This is a test.</description>
      6.     <version>0.0.1</version>
      7.     <compatibility>
      8.         <game>OSRS</game>
      9.     </compatibility>
      10.     <categories>
      11.         <category>COOKING</category>
      12.     </categories>
      13. </manifest>
      For a full manifest click here.

    • You're now ready to debug for the first time. Press the green play button on the top right of the IDE.

    • Now that RuneMate is launched and that you are logged in press "Ctrl+P".
      1. In the development section click on "Change"
      2. Go in your project folder --> out --> production --> Runemate and click "Select folder" (Make sure to select the folder above the "com" folder)

    • You should now be able to see the "Test" bot in the "BOTS" section.

    If you have any question comment it down below or join the Runemate Discord.
     
    #1 Michaud.retard, Aug 16, 2020
    Last edited: Aug 24, 2020
    Fump, Clinical and Gengsta like this.
  2. bawdog

    Joined:
    Jun 13, 2015
    Messages:
    18
    Likes Received:
    0
    On run/debug configuration it says "Warning: Class 'com.runemate.boot.Boot ' not found in module 'Runemate'"

    and then when building and running it says "
    Error: Could not find or load main class com.runemate.boot.Boot

    Process finished with exit code 1"

    EDIT: I was able to resolve it by changing JRE in IntelliJ to default "of ruemate module" and checking include dependencies with "provided" scope
     
    #2 bawdog, Aug 21, 2020
    Last edited: Aug 21, 2020
  3. Finalmen

    Joined:
    Jun 12, 2020
    Messages:
    1
    Likes Received:
    1
    Thanks for this updated guide, I had a couple of issues I will note her:

    - On first run the ''test class'' did not extend a bot/script bot. Adding ''extends LoopingBot" and extendingthe onLoop functionality made that work.
    - The JRE from Amazon for me is 64 bit. I could not figure out how to get it to 32 bit. In the end, instead of downloading a new JREI went into the run/debug configurations settings and changed the location to the RuneMate JRE which was already on this PC. This resolved this issue.

    Kind Regards,

    Finalmen
     
    Michaud.retard likes this.
  4. Voomeup

    Joined:
    Jul 23, 2020
    Messages:
    2
    Likes Received:
    0
    Hi, thanks for the guide!
    I'm still getting:

    Error: Could not find or load main class com.runemate.boot.Boot
    Caused by: java.lang.NoClassDefFoundError: javafx/application/Application
     
  5. BTDubsy

    Joined:
    May 13, 2020
    Messages:
    2
    Likes Received:
    2
    Hi, I got to the end and I have two things. One, the username and password when the client opens are both "username", im not sure if thats supposed to be like that. But I logged in anyway and went to my account and when trying to find the local bot directory I went to out then production and then Runemate but there was no "com" file anywhere and when trying to set the file to Runemate there was only the dev toolkit under the bots section.
     
    Jefferonv2 likes this.
  6. Clinical

    Joined:
    Sep 30, 2020
    Messages:
    1
    Likes Received:
    1
    Thank you very much for putting this together, it was super helpful.

    If anyone sees the error message
    Code (Text):
    1. com.username.scripts.test.test is not an instance of AbstractBot
    Then you need to do the above like Finalmen pointed out, and modify the class to be:
    Code (Text):
    1. package com.username.scripts.test;
    2.  
    3. import com.runemate.game.api.script.framework.LoopingBot;
    4.  
    5. public class test extends LoopingBot {
    6.     @Override
    7.     public void onLoop() {
    8.        
    9.     }
    10. }
    11.  
     
    Fump likes this.
  7. Tiagoo

    Joined:
    Dec 13, 2019
    Messages:
    5
    Likes Received:
    0
    Where is it the local bot directory in my account? I could't find it
     
  8. Chewie69

    Joined:
    Jan 22, 2017
    Messages:
    2
    Likes Received:
    0
    local script bot isn't showing up after set local folder
    --- Double Post Merged, Nov 10, 2020, Original Post Date: Nov 10, 2020 ---
    the out > production > *bot name* folder is also empty
     
  9. Fump

    Joined:
    Dec 5, 2019
    Messages:
    1
    Likes Received:
    0
    No when the client opens it should have your correct username and password not sure where you missed it, perhaps in the run edit configurations part. The com file should be there you may have to hit the build project button next to the run button in intellij in order to create the files. Also the
    <main-class> in the XML should point to the same location. Also Clinical has a solution to the Abstract Bot error. If you get it you have to stop and rerun.
     
  10. Ewannnnn

    Joined:
    Apr 22, 2021
    Messages:
    1
    Likes Received:
    0
    I'm trying to set this up on Ubuntu 20.04 and I'm getting the following error whenever I run the bot:

    Code (Text):
    1. Exception in thread "main" java.lang.reflect.InvocationTargetException
    2.     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    3.     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    4.     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    5.     at java.lang.reflect.Method.invoke(Method.java:498)
    6.     at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
    7. Caused by: java.lang.UnsupportedOperationException: Internal Error
    8.     at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:158)
    9.     at java.security.AccessController.doPrivileged(Native Method)
    10.     at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
    11.     at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
    12.     at com.sun.glass.ui.Application.run(Application.java:146)
    13.     at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:278)
    14.     at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
    15.     at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    16.     at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
    17.     at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    18.     ... 5 more
    Anyone know what the problem could be here?

    Edit: Turns out I needed to use the 64 bit JRE!
     
    #10 Ewannnnn, Apr 23, 2021
    Last edited: Apr 23, 2021
  11. Gold Farming Inc

    Joined:
    Jan 27, 2020
    Messages:
    3
    Likes Received:
    0
    You are my god, bro. This worked for me. I didn't know about this option to download the JDK, really cool. So the only thing I needed to do before this was download the Windows 64 bit of Runemate.

    One small thing that did trip me up for 15 minutes or so, was there was no bots showing up in runemate after I set the path.

    But there are an error message in intellij about a file not being found. The cause was because of the not consistent-ness of bot vs script bot terminology, so if anyone has this problem, double check the manifest main class thing matches the package name.

    Thanks again, someone should give you some big bucks!
     

Share This Page

Loading...