![]() |
[DuckTools] DuckAPI - A phBot-like Python plugins system
[DuckTools] DuckAPI - By Abdo Proff السلام عليكم و رحمة الله و بركاته. انا عبده بروف و جاي اقدملكم حاجة ان شاء الله تنفع و تعجب الناس. انا عملت DLL بتشتغل مع الكلاينت نفسه, متعتبرش بوت ولا محتاجة بوت علشان تشتغل. بتقدم نفس اللي phBot بيقدمه عن طريق ال Python plugins system بتاعه. الفكرة ان ده مش Silkroad Proxy او بوت الجيم لازم تعمل كونيكت عليه علشان يعرف يتعامل مع ال packets بتاعة الكلاينت او السيرفر. ده معناه ايه؟ انك تعرف تعمل بيه اللي بتحلم بيه حتي في ال Macro Servers بتاعة Maxiguard او VsroPlus ده معناه ان احنا نقدر نستعمله لوحده سواء ان احنا نفتح الجيم من ال launcher بتاعها او حاجة زي EDX Loader مثلاً, و برضه نقدر نفتح ب sBot او mBot و يبقى معانا Python plugins system زي بتاع بي اتش بوت. الحلو في ال APIs اللي انا عاملها انها بالظبط زي بتوع بي اتش بوت. فا زي ما هاتشوفوا في اول فيديو, انا بجيب البلاجن بتاع xPacketTool بتاع بي اتش بوت و بغير اسم ال APIs كالتالي... بدل كود:
from phbot import * كود:
from duckapi import * كود:
import qtbind كود:
import duckui ده اول فيديو فيه بشرح ايه الفايلات اللي هنحتاجها علشان نعرف نشغل ال API, و بشرح التشابه اللي بين ال functions و ال function signatures بتاعة ال APIs و انها بالظبط نفس بتوع بي اتش بوت. مش كل ال بي اتش بوت APIs موجودة في الفيرجن ده من ال DuckAPI. لو حابب تستخدم phBot plugin زي ما انا عملت في الفيديو اتأكد ان كل ال APIs المستخدمة فيه موجودة في DuckAPI هكتب كل ال APIs المتاحة حالياً في DuckAPI تحت بعد الفيديوهات. اول فيديو يعني ايه DuckAPI, ايه الفايلات المستخدمة, تشابه ال DuckAPIs و ال بي اتش بوت APIs, و ازاي نغير اسم ال API في phBot plugins و نستخدمها اول حاجة هنحتاجها الفايلات اللي هنحطها في فولدر اللعبة 1- DuckAPI.dll ديه ال DLL بتاعتي اللي هنعملها inject في ال sro_client.exe بتاع اللعبة. 2- python38.dll ديه ال DLL بتاعة Python علشان يعرف يتعامل. 3- ال Python environment directories اللي Python هيستخدمها و ديه في فولدر python38 اللي جوه فولدر plugins. هحط لينكات الداونلود للفايلات و ال injector تحت بعد الشرح. تاني فيديو Duck Smart Trace Plugin A better phBot trace plugin هنا بنتكلم عن ال Duck Smart Trace و ازاي تقدر تستخدمة في ال Caravan او اي استخدامات تانية. 1- لازم نعلم على ال checkbox بتاع Show Unique ID في البلاجن. 2- لازم ال CMD يبتعت "duckcmd" في ال All Chat علشان نجيب ال Unique ID بتاعه و يظهرلنا في البلاجن زي ما حصل في الفيديو. 3- ندوس علي Add CMD علشان نختار ال Unique ID بتاع ال CMD اللي اتحط بعد ما بعت الرسالة 4- هندوس Start او Stop Trace بقى براحتنا. المختلف و الحلو في الموضوع و اللي مش هتقدر تعملة في بي اتش بوت حتى لو عملت بلاجن هو ان لما ال CMD بيدوس في السما او بيستخدم الأسهم في الكيبورد علشان يتحرك, بي اتش بوت بيعطل و بيعمل trace اي هبل كدة. هنا بقى لو ال CMD عمل كدة البلاجن بيعمل game trace عادي جدا لحد ما يرجع و يدوس عالأرض تاني. خد بالك ان ال Unique ID ده بيتغير مع كل مرة ال Player بيعمل logout و login تاني. فا لو ال CMD قفل او جاله disconnect, لازم يكتب "duckcmd" تاني, و نعلم عال checkbox تاني علشان نجيب ال Unique ID الحالي البلاجن ده encrypted زي ما شرحت في الفيديو. ديه حتة تانية مختلفة عن بي اتش بوت, ان ممكن نعمل encrypt للكود بتاع البلاجن لو عايزين نديه لحد او نبيعه من غير ما يكون في قلق من ناحية ان حد يشوف ال Python كود المكتوب او يعدل فيه. الفيديو الثالث DuckControl aka xControl Plugin - How to extend the commands system and add new actions to execute هنا بنتكلم على بلاجن DuckControl او xControl لو انت استخدمته قبل كدة في بي اتش بوت. الفكرة من البلاجن ان احنا بنختار اسم Leaders معينين علشان لما يبعتولنا رسالة معينة في اللعبة نعمل حاجة معينة. Q1 Command علشان نعمل teleport من ال ferry لما حد يكتب "Q1" اكيد و انتوا في وسط Caravan و وصلتوا عند الفيري بتشوفوا ناس بتفضل تكتب Q1 و Q2 و شوية طلاسم كدة :Emoji8: ديه بتكون Chat Commands معمولة علشان لما حد يكتبها في الشات الناس اللي بتستحدم بلاجن بي اتش بوت تعمل تيليبورت اوتوماتيك. هنا بنشرح ازاي نعمل نفي الشئ ببلاجن في DuckAPI هنستعمل ال APIs الاتية: كود:
handle_chat(t, player, msg) handle_chat: 1- t = chat type (private, party, all chat, etc) 2- player = a string of the sender's name 3 - msg = a string of the received message و inject_joymax: 1- opcode = a hex opcode for the action (0x7074, 0x7021, etc) 2- data = python bytes object for the packet data 3- encrypted = boolean encrypted flag (True/False) بما ان احنا معندناش معلومات من ال media.pk2 او اي APIs زي بتوع بي اتش بوت نعرف نجيب بيها معلومات عن حاجات زي ال NPCs, Party, Character Data, و هكذا, هنحتاج نستخدم xPacketTool و نعمل Show Client Packets علشان نشوف الكلاينت بيبعت opcode و data عاملين ازاي للحاجة اللي محتاجين نعملها ب chat command زي ما عملت في الفيديو. 1- علشان انفذ ال chat command بتاعة q1 علشان لما ال leader يكتب كدة في رسالة اعمل تيليبورت اوتوماتيك من Jangan ل DonWhang, زي ما عملت في الفيديو, هجيب ال opcode و ال data اللي الكلاينت اللي هو اللعبة بتبعتها للسيرفر لما بعمل تيليبورت بأيدي عادي. 2- هروح على الكود بتاع البلاجن في handle_chat و هاجي تحت ال condition اللي بيشوف هل الرسالة اللي وصلت ديه من ال leader ولا لاً و هعمل condition جديد. 3- الكود الموجود حالياً: كود:
def handle_chat(t, player, msg): كود:
def handle_chat(t, player, msg): و نفس الكلام لما عملت ال condition بتاع ال dance. و ديه نفس الطريقة اللي تقدروا تعملوا بيها اي حاجة لما رسالة معينة تتبعت. علشان تعرف تفتح الكود بتاع اي بلاجن و تغير فيه هتحتاج IDE زي vscode او visual studio 2019/2022 ممكن برضه تستعمل حاجة زي Note++ و حتي ممكن تستعمل Notepad بس ديه شلل. Available DuckAPI UI and other APIs DuckAPI & DuckUI Documentation DuckUI APIs (User Interface) Tab & Widget Creation duckui.init(plugin_name, tab_name) - Creates a new tab for your plugin and returns tab ID duckui.createButton(tab_id, callback_name, text, x, y) - Creates a clickable button with specified callback function duckui.createCheckBox(tab_id, callback_name, text, x, y) - Creates a checkbox with optional callback function duckui.createLabel(tab_id, text, x, y) - Creates a static text label for display duckui.createLineEdit(tab_id, text, x, y, width, height) - Creates a text input field duckui.createList(tab_id, x, y, width, height) - Creates a list widget for displaying multiple items duckui.createCombobox(tab_id, x, y, width, height) - Creates a dropdown selection widget Widget Manipulation duckui.setText(tab_id, widget_id, text) - Sets the text content of labels, line edits, or comboboxes duckui.text(tab_id, widget_id) - Gets the current text content from widgets duckui.setChecked(tab_id, widget_id, state) - Sets the checked state of checkboxes duckui.isChecked(tab_id, widget_id) - Returns whether a checkbox is currently checked duckui.move(tab_id, widget_id, x, y) - Moves a widget to new coordinates duckui.destroy(tab_id, widget_id) - Permanently removes a widget from the interface List & Combobox Operations duckui.clear(tab_id, widget_id) - Removes all items from lists, comboboxes, or clears text fields duckui.append(tab_id, widget_id, text) - Adds a new item to the end of lists or comboboxes duckui.remove(tab_id, widget_id, text) - Removes the first occurrence of specified text from lists/comboboxes duckui.removeAt(tab_id, widget_id, index) - Removes item at specific index from lists/comboboxes duckui.currentIndex(tab_id, widget_id) - Returns the currently selected index in lists/comboboxes duckui.getItems(tab_id, widget_id) - Returns all items from lists or comboboxes as a Python list DuckAPI APIs (Core Functionality) Logging Functions duckapi.log(message) - Logs an informational message to the application log - Color = Black duckapi.debug(message) - Logs a debug-level message for development purposes - Color = Light Purple duckapi.info(message) - Logs an informational message (same as log) - Color = Green duckapi.warning(message) - Logs a warning message for non-critical issues - Color = Orange duckapi.error(message) - Logs an error message for critical problems - Color = Red Packet Injection duckapi.inject_silkroad(opcode, data, encrypted) - Sends a packet to the Silkroad client duckapi.inject_joymax(opcode, data, encrypted) - Sends a packet to the Joymax server Utility Functions duckapi.get_config_dir() - Returns the path to the plugin configuration directory Plugin Event Handlers Required Functions (implement in your plugin) handle_joymax(opcode, data) - Called when receiving packets from server (return True to pass through, False to block) handle_silkroad(opcode, data) - Called when sending packets to server (return True to pass through, False to block) handle_chat(chat_type, player, message) - Called when chat messages are received event_loop() - Called automatically every 500ms for continuous background tasks انا حالياً شغال على فيرجن تاني من DuckAPI بأذن الله هيكون فيه معظم ان مكنش كل ال APIs بتاعة بي اتش بوت علشان تعمل اكونت, دوس علي Register اللي في ال Login page بتاعة ال GUI هيفتح صفحة Chrome تدخل منها ال Discord server عندي. هاتدخل بعدها على channel user-panel و اعمل اكونت و اتعامل. لينك التحميل: DuckAPI DLL Injector |
رد: [DuckTools] DuckAPI - A phBot-like Python plugins system
ينقل لقسم الفحص
|
رد: [DuckTools] DuckAPI - A phBot-like Python plugins system
|
رد: [DuckTools] DuckAPI - A phBot-like Python plugins system
|
رد: [DuckTools] DuckAPI - A phBot-like Python plugins system
تسلم علي المجهود يا برنس
|
الساعة الآن 02:08 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.