[DuckTools] DuckAPI - By Abdo Proff
Hey guys, hope you're all chillin'. I'm Abdo Proff, from Cairo, Egypt, and I'm here to present something that I hope will be useful and interesting for the community.
I’ve created a DLL that works directly with the client — it's not a bot and doesn't require any bot to function.
It provides the same Python plugins system that phBot offers.
This is not a Silkroad Proxy or a game bot that you need to connect to so it can handle client/server packets. What does that mean? It means you can use it to do things you dream of — even in protected environments like Maxiguard or VsroPlus macro servers.
That also means we can use it standalone, whether launching the game via its original launcher or something like EDX Loader. And we can still use it alongside sBot or mBot — but now with a phBot-like Python plugin system.
The great thing about the APIs I built is that they're almost identical to phBot's. As you’ll see in the first video, I took the xPacketTool plugin from phBot and just changed the library names as follows...
Instead of
Code:
from phbot import *
Code:
from duckapi import *
Code:
import qtbind
Code:
import duckui
This first video explains the required files to run the API, and shows how similar the function names and signatures are to phBot’s.
Not all phBot APIs are available in this version of DuckAPI. If you want to reuse a phBot plugin like I did in the video, make sure all used APIs exist in DuckAPI.
I'll list all currently available DuckAPI APIs below the videos.
First Video
What is DuckAPI, required files, API similarity with phBot, and how to adapt existing phBot plugins.
What is DuckAPI, required files, API similarity with phBot, and how to adapt existing phBot plugins.
|
|
First, here are the files you’ll need to put inside your game folder:
1. `DuckAPI.dll` — this is my DLL that you'll inject into `sro_client.exe`.
2. `python38.dll` — the Python runtime DLL required to run the interpreter.
3. The Python environment directories inside the `python38` folder located in the `plugins` folder.
I'll post download links for the files and the injector after the tutorial section.
Second Video
Duck Smart Trace Plugin — A better phBot trace plugin
Duck Smart Trace Plugin — A better phBot trace plugin
|
|
In this video, I show how to use the Duck Smart Trace plugin for caravans or other purposes:
1. You must enable the “Show Unique ID” checkbox in the plugin.
2. The CMD must send `duckcmd` in All Chat to fetch the CMD’s Unique ID so it appears in the plugin (as shown in the video).
3. Click “Add CMD” to select the Unique ID of the CMD after the message is sent.
4. Then click Start or Stop Trace as needed.
The cool part — something even phBot plugins can’t handle — is that if the CMD presses in the sky or moves using keyboard arrows, phBot goes nuts and traces incorrectly. But here, the plugin uses game trace to continue tracing the CMD, until they press somewhere on ground again.
Note: The Unique ID changes every time the player logs out and back in.
So if the CMD disconnects or closes the game, he must send `duckcmd` again, and you must recheck the box to get the new ID.
So if the CMD disconnects or closes the game, he must send `duckcmd` again, and you must recheck the box to get the new ID.
This plugin is encrypted, as shown in the video.
This is another feature that makes DuckAPI different from phBot — you can encrypt plugin code if you want to sell or share it without exposing your Python source or allowing edits.
Third Video
DuckControl (aka xControl Plugin) — Extend command handling and add new actions
DuckControl (aka xControl Plugin) — Extend command handling and add new actions
|
|
In this video, we discuss the DuckControl plugin, which is similar to phBot’s xControl plugin.
The idea is to designate certain players as “Leaders.” When those players send certain chat messages in-game, specific actions are automatically performed.
Q1 Command — Auto-teleport from ferry when “Q1” is typed
You’ve probably seen people spam “Q1” or “Q2” during caravans — those are chat commands used with plugins like phBot’s xControl to auto-teleport.
Here I show how to replicate the same behavior using a DuckAPI plugin.
We’ll use the following APIs:
Code:
handle_chat(t, player, msg) inject_joymax(opcode, data, encrypted)
Just like in phBot:
handle_chat:
1- `t` = chat type (private, party, all chat, etc)
2- `player` = sender’s name (string)
3- `msg` = received message (string)
inject_joymax:
1- `opcode` = the action's hex opcode (e.g. 0x7074, 0x7021)
2- `data` = Python bytes object containing packet data
3- `encrypted` = whether the packet is encrypted (True/False)
Since we don’t have access to media.pk2 data or helper APIs like phBot, we need to use xPacketTool and enable “Show Client Packets” to observe opcodes and data sent by the game client for the actions we want to replicate via chat command.
1- To implement the `q1` teleport command — like teleporting from Jangan to Donwhang — I capture the opcode and data the client sends to the server when I manually teleport.
2- Then, in the plugin code under `handle_chat`, I add a condition that checks if the message came from a leader and whether the message equals "q1".
3- Here’s the current code:
Code:
def handle_chat(t, player, msg):
if t in [2, 4, 5, 7]:
if is_leader(player):
info(f"Message from leader {player}: {msg}")
Code:
def handle_chat(t, player, msg):
if t in [2, 4, 5, 7]:
if is_leader(player):
if msg == "q1":
inject_joymax(0x705A, b"\x1A\x01\x00\x00\x02\x04\x00\x00\x00", False)
info(f"Message from leader {player}: {msg}")
Same goes for any other command you wish to add to replicate a specific client action.
To edit a plugin, you’ll need an IDE like VSCode or Visual Studio 2019/2022.
You *could* use something like Notepad++ or even basic Notepad — but that would be painful :)
To use this, you can register a new account to use this on [Only registered and activated users can see links. Click Here To Register...]
Discord registration has been disabled to comply with the forum's rules.
I literally made this entire project in a few days without enough testing, so I am expecting errors to come up, and hopefully get reported and solved ASAP.
Download links:
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]