Jump to content
  • Create New...

[GUIDE] Running a Script from IntelliJ

Recommended Posts

If you're not able to run the client as most users do and have scripts from the SDN operate, this is the wrong guide for you.

If you're already running scripts and ready to write your own, keep reading.


If you haven't yet set up your IntelliJ project, start by making a new project that uses a java between Java 11 - 14.  Name it whatever you'd like.  I chose "DeleteSoon".

Download the Client SDK and Client SDK Scriptloader (https://powbot.org/community/index.php?/forum/56-downloads/) and put them somewhere convenient.  I have a folder on my desktop.


In your project, right click the main directory and choose "Open Module Settings"


Go to "Libraries" and add each .jar as a new Java project library using the + sign at the top.  I did them one at a time, I'm not sure if it matters though.


Tab over to "Modules" and make sure it looks like this:



Set up your directory paths, I'd recommend something like this:


If your folders are "combining" their names and you don't want them to, right click the space right above your main folder name and turn off "Flatten packages".


Make a java file called "TesterScript" like I did above.  Paste this into it and adjust your package name:

package authorname.scripts.tester;

import org.powbot.api.script.AbstractScript;
import org.powbot.api.script.ScriptManifest;
import org.powbot.mobile.service.ScriptUploader;

        name = "Tester EXACT NAME",
        description = "Tests",
        version = "0.0.1"

public class TesterScript extends AbstractScript {

    public static void main(String[] args) {
        new ScriptUploader().uploadAndStart("Tester EXACT NAME", "Account", null, false, true);

    public void poll() {
        System.out.println("You should see this in your console.");


To launch a script, your manifest name and the name in your main() must match exactly.

Open a client like you normally would to run a script.  Wait for everything to finish loading.

Run the script by right clicking it in your project and selecting "Run main()"


If it doesn't run, try these command line scripts after adjusting the path to adb.exe:

C:\Users\NAME\.powbot\android\platform-tools\adb.exe kill-server
C:\Users\NAME\.powbot\android\platform-tools\adb.exe forward tcp:61666 tcp:61666
C:\Users\NAME\.powbot\android\platform-tools\adb.exe devices

It should look something like this:


These commands reset the link, tell you what devices are connected, and then set up communications.


If you still can't get a script running there's a bigger issue going on, ask in #help in Discord.



Some other useful info:

If you want to choose which client to attach the script to, run the adb.exe devices command.  An unbound client will have a name like "".  Replace null with that instance name string.

With AbstractScript poll() will get called approximately every 50ms, or instantly after finishing the previous poll() if it took longer than 50ms.

Edited by Joonks
Link to post
Share on other sites

  • Joonks changed the title to [GUIDE] Running a Script from IntelliJ
  • const_ pinned this topic
  • 2 months later...

Was getting this error port-forwarding on Windows 10

adb.exe: error: cannot bind listener: cannot bind to An attempt was made to access a socket in a way forbidden by its access permissions. (10013)


> net stop hns
and then
>net start hns
and retried port-forwarding and it worked.

In case anybody else gets this problem.

  • Thanks 1
Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now