Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Hacks, Bots, Cheats & Exploits
You last visited: Today at 02:58

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[DuckTools] DuckAPI - A phBot-like Python plugins system

Discussion on [DuckTools] DuckAPI - A phBot-like Python plugins system within the SRO Hacks, Bots, Cheats & Exploits forum part of the Silkroad Online category.

Reply
 
Old   #1
 
abdopro3's Avatar
 
elite*gold: 0
Join Date: May 2019
Posts: 6
Received Thanks: 9
Cool [DuckTools] DuckAPI - A phBot-like Python plugins system

[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 *
I used
Code:
from duckapi import *
And instead of
Code:
import qtbind
I used
Code:
import duckui
And the rest of the code literally stays the same.

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.





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




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.


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





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}")
I add the condition for `q1`, and it becomes:

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}")
This tells the plugin: if a message from a leader equals "Q1", send the same opcode and packet the client would use when manually teleporting.

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
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.


Currently Available APIs




Download links:




abdopro3 is offline  
Thanks
7 Users
Old 07/23/2025, 08:33   #2
 
elite*gold: 0
Join Date: Nov 2013
Posts: 127
Received Thanks: 14
Wow what a great work
wxcxc is offline  
Old 07/24/2025, 01:50   #3


 
Kabloz™'s Avatar
 
elite*gold: 17
Join Date: Aug 2016
Posts: 434
Received Thanks: 230
Kabloz™ is offline  
Old 07/27/2025, 01:06   #4
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 419
Received Thanks: 943
This can be kinda useless without the game database.
I recommend you to use just to generate such database in sqlite3 format, easy to use in python.
JellyBitz is offline  
Thanks
1 User
Old 07/27/2025, 01:16   #5
 
abdopro3's Avatar
 
elite*gold: 0
Join Date: May 2019
Posts: 6
Received Thanks: 9
Quote:
Originally Posted by JellyBitz View Post
This can be quite useless without the game database.
I recommend you to use just to generate such database in sqlite3 format, easy to use in python.
Jellyyyy, dude your xbot code already helped me a lot and I am already using it as a reference in my C++ media contents extraction. I am just using a different method since it's a DLL, I am calling the gfxfilemanager's IFileManager's functions to read from the media at runtime and extract the needed data.

Much love, bro!
abdopro3 is offline  
Old 07/27/2025, 03:45   #6
 
JellyBitz's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 419
Received Thanks: 943
Quote:
Originally Posted by abdopro3 View Post
I am just using a different method since it's a DLL, I am calling the gfxfilemanager's IFileManager's functions to read from the media at runtime and extract the needed data.
Yeh, it's a way but not recommended, in such case it's better to retrieve the data from the .

Parsing/analyze all the files can take a while on start and I know it can be annoying reading all those files from C++ (I did it before). I'm just giving as option xBot to people here start making some advance addons, xBot already extracts a pretty good database in sqlite3.

Left a database sample from Silkroad Latino.
Attached Files
File Type: rar Database.rar (1.31 MB, 28 views)
JellyBitz is offline  
Thanks
1 User
Old 07/27/2025, 13:26   #7
 
abdopro3's Avatar
 
elite*gold: 0
Join Date: May 2019
Posts: 6
Received Thanks: 9
This is just brilliant. Thank you so much!
abdopro3 is offline  
Old 08/04/2025, 04:56   #8
 
elite*gold: 0
Join Date: Oct 2011
Posts: 17
Received Thanks: 3
Angry

the tool is good but that guy is childish af I asked him 2 questions on the discord server then for no reason he kicked me from it
1- the tool is not working with me on windows 10 lite host is virtual machine
he said it's because of vmprotect
2- are you willing to add get_monsters() later to the tool?

after a respectful response from me on both mints after I found myself banned
NONONO2 is offline  
Old 08/04/2025, 16:23   #9
 
abdopro3's Avatar
 
elite*gold: 0
Join Date: May 2019
Posts: 6
Received Thanks: 9
Quote:
Originally Posted by NONONO2 View Post
the tool is good but that guy is childish af I asked him 2 questions on the discord server then for no reason he kicked me from it
1- the tool is not working with me on windows 10 lite host is virtual machine
he said it's because of vmprotect
2- are you willing to add get_monsters() later to the tool?

after a respectful response from me on both mints after I found myself banned
It's literally my server, my code, and my thread. I don't see a reason you should feel that I am childish if I decide that I don't like how our interaction went and that I don't want you in my server. It's pretty simple really.

I am glad you enjoyed the tool for the few minutes you were allowed to use it, though.
abdopro3 is offline  
Old 08/04/2025, 17:40   #10
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,840
Received Thanks: 4,672
Quote:
Originally Posted by abdopro3 View Post
It's literally my server, my code, and my thread. I don't see a reason you should feel that I am childish if I decide that I don't like how our interaction went and that I don't want you in my server. It's pretty simple really.

I am glad you enjoyed the tool for the few minutes you were allowed to use it, though.
I only now see that you have to create an account on your Discord to use the program. Unfortunately I see an indirect advertisement for your Discord server and the section “SRO Hacks, Bots, Cheats & Exploits” would not be the right one. Would you like to change that, alternatively I would close your thread.
Devsome is offline  
Thanks
2 Users
Old 08/04/2025, 17:53   #11
 
abdopro3's Avatar
 
elite*gold: 0
Join Date: May 2019
Posts: 6
Received Thanks: 9
Thumbs up

Quote:
Originally Posted by Devsome View Post
I only now see that you have to create an account on your Discord to use the program. Unfortunately I see an indirect advertisement for your Discord server and the section “SRO Hacks, Bots, Cheats & Exploits” would not be the right one. Would you like to change that, alternatively I would close your thread.
I am okay with that. I have to link this to my server since I need to disable certain packets in specific editions to prevent creating plugins that could ruin gameplay uncontrollably, such as plugins that automatically attack other players and so on. So, it can be moved to whichever other section it belongs to, closed, or completely removed.

I created it and wanted to share it with people but in a way that still allows me to control its use, in case it ruins servers, especially with it being as powerful as it is, handling packets in macro vsroplus and maxiguard servers, which server owners pay well enough to have, especially that I am working on adding more APIs that people at some point can use to create a working bot in non-bot servers.

But if it's against the rules, then it is what it is.
abdopro3 is offline  
Old 08/04/2025, 22:00   #12
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,840
Received Thanks: 4,672
Then I'll close here, if you post it without being in a Discord server to create an account, I can open the thread again.

#closed
Devsome is offline  
Old 12/01/2025, 15:26   #13
 
elite*gold: 0
Join Date: Jan 2014
Posts: 25
Received Thanks: 3
Wow what a great work
ahmedcar2 is offline  
Reply


Similar Threads Similar Threads
phBot Manager , fully managing for phBot
08/26/2023 - SRO Hacks, Bots, Cheats & Exploits - 89 Replies
phBot Manager never connect to internet supports iSRO and rSRO download it only from here or Official Site www.phbot-manager.com phBot Manager 2.8 for phBot v10.4.3 * Updated for phBot v10.4.3
Help For phBot Plugins
08/01/2021 - Silkroad Online - 1 Replies
Hello everyone, Today i want help with plugins from you . I follow most plugins on phbot forums. Especially JellyBlitz's. I noticed that they are attacking with bot characters in the arena and fgw recently. I also noticed that some characters attack when certain characters are attacked, and some attack as soon as a character attacks. So I think they are doing this using Jelly Bitz's xTargetSupport plugin. Because xTargetSupport can do exactly that, but I know it only targets. They must be...
Help For phBot Plugins
09/28/2020 - SRO Coding Corner - 0 Replies
Hello everyone, Today i want help with plugins from you :). I follow most plugins on phbot forums. Especially JellyBlitz's. I noticed that they are attacking with bot characters in the arena and fgw recently. I also noticed that some characters attack when certain characters are attacked, and some attack as soon as a character attacks. So I think they are doing this using Jelly Bitz's xTargetSupport plugin. Because xTargetSupport can do exactly that, but I know it only targets. They must be...
PhBot, server issues like sbot? cause they both dont work
10/04/2010 - Silkroad Online - 4 Replies
PhBot website doesn't load either just like sbot, and no clue why it doesnt work. Anyone else has this issue with phbot? or any news when it gets back online, post here please.



All times are GMT +1. The time now is 02:58.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.