Skip to content

Conversation

@Egezenn
Copy link
Contributor

@Egezenn Egezenn commented Nov 27, 2025

An effort to better expose bots' functionality for headless & programmatic control.

User is able to create named pipes with the name they specify and the bot can listen to that pipe. Allowing seperation for multiple swarms. Features are to be tested. Need better aliases for the options (gave a random one for each, to be made semantic™️)

All communication is made via JSON.

Example command line interface functionality exposed via this PR:

RSBot

IPC Server to Listen to

RSBotIPC pipe is default in Server and Controller, however the user explicitly needs to specify the server to be listened.

RSBot.exe -p profile -l RSBotIPC

Autologin

Creating a New Autologin

RSBot.exe -p profile -e(--create-autologin) --username username --password password
RSBot.exe -p profile -e --username username --password password --secondary-password --provider-name JCPlanet --server Xian

Selecting an Autologin

RSBot.exe -p profile -a(--select-autologin) username

RSBot.Server

A background process for bots to connect to and for the controller to relay messages to. Everything is logged onto User/Logs/Environment/Server.exe.

RSBot.Server -x(--pipename) RSBotIPC

RSBot.Controller

Command line interface to control the bot without any GUI.

RSBot.Controller.exe -x RSBotIPC -p(--profile) profile -c(--command) command -d(--data) data
RSBot.Controller.exe -x RSBotIPC -a(--all) -c command -d data

Commands are:

  • Start
  • Stop
  • GetInfo
  • SetVisibility
  • SetClientVisibility
  • ...

Roughly Desired Architecture

graph LR;
cli[CLI]

a["✅start a profile (create if not existent)"]
a1[✅preselect a character]
a1_2["💤set options"]
a1_2_1[✅create autologin]
a1_2_2[✅select autologin]
a1_2_3[❌...]
c[✅listen to ipc]
d["💤copy a profile<br>(for a new login and character)"]

cli-->a
a-->a1

a-->a1_2
a1_2-->a1_2_1
a1_2-->a1_2_2
a1_2-->a1_2_3

cli-->c
cli-->d
Loading
graph LR
ipc["IPC"]
b[❌fetch the necessary data from User dir]
c[✅get info from current rsbot processes]
f["❌send commands to the specified profile(s)"]

f1[✅start/stop bot]
f2[✅go clientless]
f3[✅set client visibility]
f4[💤move]
f5[💤specify training area]
f6[💤select botbase]
f7[💤return to town]
f8["✅launch client(s)<br>kill client(s)"]
f9["✅return info<br>PID<br>uptime<br>profile<br>visibility of client<br>visibility of window<br>character location<br>current botbase"]
f10[✅set bot UI visibility]


ipc--initialization-->b-->c
ipc-->f
f-->f1
f-->f2
f-->f3
f-->f4
f-->f5
f-->f6
f-->f7
f-->f8
f-->f9
f-->f10
Loading

Multiple ipc servers can coexist, they should be named differently.

Diagram of Operations

sequenceDiagram
    participant CLI as RSBot.Controller.exe
    participant Server as RSBot.Server.exe
    participant Bot as RSBot.exe

    Server->>Server: Start and create Named Pipe
    
    Bot->>Server: Connect to Named Pipe
    Server-->>Bot: Connection established
    Bot->>Server: Send RegisterBot command
    Server->>Server: Register Bot instance with profile

    CLI->>Server: Connect to Named Pipe
    Server-->>CLI: Connection established
    CLI->>Server: Send GetInfo command
    
    Server->>Bot: Route GetInfo command
    Bot->>Bot: Process GetInfo command (gather info)
    Bot->>Server: Send IpcResponse with info
    
    Server->>CLI: Route IpcResponse
    CLI->>CLI: Display response
    
    CLI->>Server: Disconnect
    Server-->>CLI: Acknowledge disconnect
Loading

@Egezenn Egezenn marked this pull request as draft November 27, 2025 14:23
This commit introduces several new functionalities and improvements to the Inter-Process Communication (IPC) system:
- **Client Management Commands:**
	- Implemented `LaunchClient` command: Allows launching a game client instance remotely via IPC.
	- Implemented `KillClient` command: Enables terminating a running game client instance remotely via IPC.
	- Implemented `SetClientVisibility` command: Provides the ability to show or hide the game client window remotely via IPC.
- **Batch Command Operations:**
	- Added `--all` option to `RSBot.Controller`: Users can now send a single command to all connected bot instances listening on a specific IPC server.
	- Enhanced `RSBot.Server` routing: The server now correctly broadcasts commands to all bot clients when the `TargetAllProfiles` flag is set in an `IpcCommand`.
	- Improved `RSBot.Controller` response handling: The controller now collects and displays all responses from multiple bot instances when a batch command is executed, rather than just the first response.
- **IPC Structure Updates:**
	- Added `TargetAllProfiles` boolean property to `IpcCommand` to facilitate batch command routing.
These changes significantly enhance the control and flexibility of managing multiple RSBot instances via the command-line interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant