Jump to content
×
×
  • Create New...

[How To] Setup Local Scripts


Recommended Posts

Quick guide for setting up local scripts in IntelliJ.

I assume that you have IntelliJ installed already.

You must have Java 11-14  to run PowBot. You can download it from https://adoptopenjdk.net/.

 

First, you must download PowBotLoader from https://powbot.org/download.

After running PowBotLoader once you should have the required PowBot.jar in "C:\Users\YourName\.powbot\client" ( on Windows). You will use PowBot.jar in the next section NOT PowBotLoader.

Open IntelliJ.

Click on the File->New->Project. Select Java and make sure that under Project SDK you have java 11 or higher. Click Next and Next again.

step1.thumb.png.8b212fea3205aa25e56ae6801445a001.png

Now you can name your project whatever you want and select the location. Click Finish.

step2.thumb.png.a5354440414ff272946863e368228c3c.png

Once you have completed that you should have a new empty project.

On the left side right click on your project name and select "Open Module Settings", the window on the right side should be open now.

Select Libraries under Project Settings and click on the "+" sign and select Java.

step3.thumb.png.5ffd255ae699cd664f1c327eb8ecbf61.png

Find and select the PowBot.jar . Click OK, then Apply and then again OK to close the window. (The screenshot below shows an old jar file name)

step4.thumb.png.8d698943a2f0fc5e952f82c90fb472d6.png

Now we need to setup run configuration. Click on Run->Edit Configuration on the top toolbar. The configuration window should be open now.

Click on the "+" sign, choose Application.

n step5.thumb.png.8647e406dd799c584a1caf73cc42229f.png

Now name your configuration however you want.

Under Main class put jagexappletviewer.

Under VM  options put "-Xmx1024m -XX:+UseG1GC"

Make sure that jre version is correct. Now click Apply and OK.

step6.thumb.png.ea43b7c92910633ebaefd2762dfaf599.png

You should now be ready to start making some scripts.

Double click on your project name on the left side to expand the menu. Now right click on src (folder for all of your source files) and select New->Java class and name it Main.

step7.thumb.png.1ceee9fbee2cb4404f2aa61ab424df41.png

Your class will be empty. The code in the picture is the minimum you'll need to run the script.

step8.thumb.png.46eb2fb8b26bc5ea02ef7faf1f0c4d35.png

If you have written the necessary code you can now run the app.  Select Run->Run "ProjectName" . It will compile and run the client.

Hopefully you got something like this. In the client if you select File->Play you should see your script name ( name comes from the manifest)

final.thumb.png.10fdd636a1a4017c77d7a729d1964186.png

That's it!

Good luck with scripting.

 

Edited by Toma
Updating rsbot references
  • Like 2
Link to post
Share on other sites
  • Moderators

Updated the thread, there were references to the loader jar rather than the exe, and people are downloading the old jar from here.

Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...
On 3/6/2021 at 8:40 AM, bigA21 said:

PowBotLoader never finishes the loading it just gets stuck on 99% for me. image.png.b888fbc360905ae809e1ec05ac100894.png

Any help would be greatly appreciated.

 

Thanks

I had the same problem when using jdk14, but it works with jdk11

Link to post
Share on other sites
3 hours ago, petroboti said:

I had the same problem when using jdk14, but it works with jdk11

Yeah, @bigA21 if anyone is having loading issues, if you download jdk11 you can configure your IDE to point to it and it should work.

If you're also having issues with loading the client individually you can have the java jdk11 binary point to the powbot.jar and it should also work

Link to post
Share on other sites
  • 4 weeks later...

How does the classloader work? Does it look for a specific folder to load scripts from? I'm building to ~/.powbot/scripts but no scripts get loaded in PowBot.
OP claims that simply running bot and clicking 'File->Play' will load script. Does this mean PowBot script classloader is looking in the default Intellij build folder (out)? Is there any way to change what folder is being read for class files?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.