Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Exploits, Hacks, Bots, Tools & Macros
You last visited: Today at 22:14

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

Advertisement



Py4GW: A Python-Based Scripting Library for Guild Wars

Discussion on Py4GW: A Python-Based Scripting Library for Guild Wars within the GW Exploits, Hacks, Bots, Tools & Macros forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Py4GW: A Python-Based Scripting Library for Guild Wars

Py4GW: A Python-Based Scripting Library for Guild Wars

Hey everyone,

I wanted to take a moment to introduce a new tool that I’ve been working on, Py4GW, which aims to provide a better and more flexible way to script for Guild Wars using Python.

What is Py4GW?

Py4GW is a Python wrapper for GWCA. The idea behind Py4GW is simple: I wanted to make it easier for everyone to write scripts by linking Python to GWCA. This allows you to script Guild Wars without needing to dive into C++ code or worry about compiling projects.

Python’s syntax is beginner-friendly but also powerful enough to handle advanced scripting tasks. By integrating it with GWCA, I’ve created a tool that combines Python's ease of use with the deep control that GWCA provides.

Why Was Py4GW Created?

You’ve likely encountered GWCA. It’s very powerful, but accessing it has required compiling C++ projects, which isn’t ideal for many scripters. The barrier of entry was simply too high.

That’s where Py4GW comes in. It provides a Python-based interface to GWCA, allowing you to:

- Access GWCA’s rich functionality without having to write or compile C++ code.
- Access GWToolbox functionality and advanced commands.
- Leverage Python’s simplicity to quickly create, modify, and maintain scripts.

This isn’t just about making things easier—Py4GW unlocks new capabilities for automation and scripting by giving more people access to the deep features of GWCA and Python, without the technical overhead of C++.

Why Python?

Python is one of the most popular programming languages in the world, and for good reason:

- It’s easy to learn for newcomers and very readable.
- It has a huge ecosystem of libraries and tools, allowing you to expand your scripts in ways that would be difficult or impossible with other languages.
- Maintenance: Python scripts tend to be cleaner and easier to maintain over time. Even larger projects are much more manageable due to its structure.

By linking Python with GWCA, I’ve removed the need to compile anything. This makes scripting faster, easier, and much more accessible.

Is GWCA Faster than GWa2?

Yes.

But seriously, let’s get into why GWCA is generally faster and more efficient than GWa2, which is built on AutoIt.

AutoIt scripts, like those in GWa2, work by calling external DLLs and using memory reading techniques that often involve slower memory operations. AutoIt itself is an interpreted language that wasn’t designed for high-performance tasks. Every function call has overhead, and when accessing memory or calling DLL functions repeatedly, the performance drops significantly.

Py4GW, on the other hand, directly accesses GWCA via Python bindings. By bypassing external DLL calls and interacting with GWCA at a lower level, Python bindings allow you to leverage the native speed of GWCA’s C++ functions.

In short, while AutoIt has to rely on repeated slow memory reads and external DLL calls, Py4GW via Python bindings interacts directly with GWCA, resulting in faster execution and more responsive scripts.

Advantages of Python over AutoIt

There are several additional advantages of using Python for scripting over AutoIt:

1. Larger ecosystem of libraries: Python has a vast range of third-party libraries that make it easier to perform tasks like networking, file operations, data processing, and more. AutoIt’s ecosystem is much smaller.
2. Cross-platform support: Python is cross-platform, meaning you can run Python scripts on Windows, Linux, or macOS with minimal changes, whereas AutoIt is primarily Windows-based.
3. Better maintainability: Python’s clean, readable syntax makes it easier to manage larger projects and maintain scripts over time.
4. Stronger debugging tools: Python’s debugging tools, such as PDB, provide advanced features like breakpoints, live variable inspection, and step-through debugging.
5. Community support: Python has a large global community with extensive documentation, tutorials, and active forums.
6. Object-Oriented Programming (OOP): Python supports full OOP, which allows for the creation of reusable, modular code structures. AutoIt has limited support for OOP.
7. Integration with modern tools: Python integrates seamlessly with CI/CD pipelines, cloud platforms, and version control systems like Git.
8. Concurrency and asynchronous programming: Python supports multi-threading and async programming, allowing you to run multiple tasks concurrently. AutoIt’s concurrency features are limited.
9. Error handling: Python’s robust try-except blocks provide better error handling and debugging.

ChatGPT Knows How to Code!

One exciting feature is that ChatGPT or similar AI models can help you write code! You can use ChatGPT to generate scripts based on Py4GW’s demo files, as all of the demo scripts were created using ChatGPT. With clear prompts and examples, ChatGPT can be a valuable tool in building your own automation scripts.

Current Status of the Library

Most of the base functions in Py4GW are bound to Python, allowing direct access to GWCA’s core features. However, the library itself is complex, and using it requires instantiating objects and understanding how to handle them properly.

The demo files provide a solid foundation, but more refined instructions and routines are needed to make the library even more approachable.

Do I Need Your Help? Yes, Yes I Do.

Building Py4GW has been a challenging and exciting journey, but there’s still much to be done, and I need help! If you’re familiar with Python or C++, your expertise is welcome.

Here’s how you can get involved:

- Try it out: Download Py4GW, run the demo scripts, and see how it fits your needs.
- Share your ideas: Have suggestions for improvements? Let me know!
- Contribute: Share any scripts or routines that could benefit others.
- Give feedback: If you encounter issues, your feedback will help improve the library.

Requirements

To get started with Py4GW, you’ll need:

- Python 3.12 (32-bit): Since Guild Wars is a 32-bit application, ensure you install the 32-bit version of Python.
- GWToolbox: Py4GW works in conjunction with GWToolbox. Load the Py4GW plugin in GWToolbox to start scripting. Py4GW.dll need to go in toolbox plugin folder, scripts can be anywhere.
- Text Editor: Notepad or any other text editor for script writing.
- Microsoft Visual Studio (MSVS) or other advanced Python editors: Tools like PyCharm or VSCode provide IntelliSense and code completion.
Since its an embedded interpreter, launching and debugging from the IDE are not possible without developing custom tools.

Where can we talk about it?.
I created a discord server so communication is faster and more direct, is youre interested, join and lets build this together!



I’m excited to see if this tool gains traction. Let me know your thoughts, and happy scripting!

Apoguita
Attached Files
File Type: rar Py4GW_V1.0.1.rar (1.46 MB, 259 views)
apoguita is offline  
Thanks
18 Users
Old 09/29/2024, 13:21   #2
 
elite*gold: 0
Join Date: Sep 2017
Posts: 15
Received Thanks: 2
Pretty cool. Since I’m familiar with Python, I like it. I’ll definitely take a look at it when I have some free time. Keep up the great work!
0815Storm is offline  
Old 09/29/2024, 16:30   #3
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Where can we talk about it?.
I created a discord server so communication is faster and more direct, is youre interested, join and lets build this together!

apoguita is offline  
Old 09/30/2024, 19:05   #4
 
Scythe X's Avatar
 
elite*gold: 0
Join Date: Aug 2023
Posts: 80
Received Thanks: 62
For installing plugins to GWToolbox, here is the default GWToolbox++ Plugin folder location:

C:\Users\USERNAME\Documents\GWToolboxpp\COMPUTERNA ME\plugins
Scythe X is offline  
Thanks
1 User
Old 10/09/2024, 17:07   #5
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
for those wondering if the project is advancind and being worked on, partial updates are handled in the Discord, i will update the forum verwsion once 1.0 is ready to launch, if you feel like trying the library, you can find updateds files and routines there
apoguita is offline  
Thanks
1 User
Old 10/15/2024, 00:09   #6
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Py4GW v1.0.0-beta.1

is ready to be tested.

head over to the discord to get it since partial releases are handled there/
apoguita is offline  
Thanks
1 User
Old 10/22/2024, 17:57   #7
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Changelog

[v1.0.0-beta.2] - 2024-10-22

Overview
The second beta release expands the library with advanced systems for managing bot behavior. This release introduces both Behavior Trees for complex decision-making and a Finite State Machine (FSM) for state-based control. Additionally, an Overlay class has been added for in-game drawing and manipulation, alongside other performance improvements.

Added
  • Behavior Trees: Introduced a flexible system for managing bot decision-making. Behavior Trees allow for complex, hierarchical actions based on conditions and priorities.
  • Finite State Machine (FSM): Implemented FSM functionality to manage state-driven bot actions, allowing structured and predictable transitions between different behaviors.
  • Overlay Class: Added a new class that allows for in-game drawing and manipulation, enabling visual elements and interactive overlays directly within the game interface.

Improved
  • Performance optimizations for game interaction handling.

Fixed
  • Trading with merchants: The issue with merchant trading has been resolved and will be incorporated in the next release (v1.0.0-beta.3).

Known Issues
  • None.

Notes for Beta Testers
Please test the Behavior Tree, FSM, and Overlay features. Your feedback on performance, ease of use, and any suggestions for enhancements are greatly appreciated. Continue to report bugs, share functionality ideas, and provide any relevant code for testing purposes.

Partial Updates are handled in the discord server, head over theres to get the latest.
apoguita is offline  
Thanks
2 Users
Old 11/07/2024, 08:28   #8
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
V1.0.0-beta.3

`Changelog`

`[v1.0.0-beta.3] - 2024-11-07`

Overview
The third beta release brings major functionality additions and enhancements to improve game management capabilities within the bot. This update introduces a range of agent filtering options, quest management, and full merchant interaction, alongside improvements in ImGui flexibility.

Added
  • AgentArray Class: (thanks The1ne) Expanded with multiple filtering methods, providing versatile options to filter agents based on various conditions and attributes, enhancing agent management.
  • PyQuest Class: Introduced basic quest handling functionality, allowing for tracking and abandoning active quests. Additional quest features are planned for future updates.
  • PyMerchant Library: Implemented a comprehensive system for interacting with all types of merchants, including:
    • Traders: Material Trader, Rare Material Trader, Rune Trader, Dye Trader, and Scroll Trader.
    • Merchants: General merchant support.
    • Crafters: Including Weapon Crafters, Armor Crafters, Artisans (Material Crafters), and Consumable Crafters.
    • Collectors: Full interaction support for in-game collectors.
  • PyImGui Enhancements: Added `__or__` operators to enable combining multiple ImGui flags during object declaration, simplifying UI element configuration.

Improved
  • Enhanced ImGui functionality to streamline flag handling for more flexible and readable code.

Updated DEMO Files
  • Py4GW_DEMO.py
  • DEMO_PyMerchant.py

Notes
- There is a halfway-done Item Mod Recognition system that will help you determine mods and their values. This is a work in progress (`ItemCompare.py`).

Notes for Beta Testers
Testers are encouraged to explore the new filtering options, quest handling, merchant interactions, and ImGui enhancements. Feedback on functionality and ease of use, as well as any bug reports or feature suggestions, will be valuable for further refinement.


For accessing the tool , Visit our discord!
apoguita is offline  
Old 11/14/2024, 21:18   #9
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Temporary fix added, included a modified toolbox version that works with plugins.

Head over to the discord or here
apoguita is offline  
Old 11/18/2024, 10:21   #10
 
elite*gold: 0
Join Date: Sep 2024
Posts: 1
Received Thanks: 0
Gave it a go to set it up, got it working, tested the BorealDemo with some minor adjustments works like a charm.

One thing i seem to have noticed is that Guildwars freezes during 'select script file' until a file is choosen. Although that might also just be my enviroment, need further testing to confirm.

Great job
justlookingforbot is offline  
Old 11/18/2024, 14:07   #11
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
Quote:
Originally Posted by justlookingforbot View Post
Gave it a go to set it up, got it working, tested the BorealDemo with some minor adjustments works like a charm.

One thing i seem to have noticed is that Guildwars freezes during 'select script file' until a file is choosen. Although that might also just be my enviroment, need further testing to confirm.

Great job
Thanks!

Visit our discord,! a more up to date library is being developed there.

This library already surpassed all non gwca libraries in features, ease of use and performance.

Library already has all basic game control sorted out, we're working on advanced features like map handling, automatic pathfinding. Etc.

We have a pretty powerful skill handling motor to automate combat bots.

Best of all, this library is not subject to headers and it's breakages.

This library uses a safe communication channel to mask itself as a toolbox agent. We do not use ctos, which is what anet is looking to monitor with this changes.

************************************************** *********************

# Changelog

## [v1.0.0-beta.4] - 2024-11-18


### Overview
This release introduces significant advancements in concurrency, inter-process communication, and pathfinding capabilities, laying the groundwork for advanced bot integration and automation. The new features enable bidirectional communication between Python and AutoIt, while also expanding the library with game-derived pathing data for enhanced navigation.

### Added
- **Multithreading Class**: Provides robust handling of concurrent work, enabling smoother and more efficient operations across multiple threads.
- **TCP/IP Server-Client Communication for IPC**:
- Implemented server and client libraries for Python.
- Proof-of-concept integration with AutoIt, allowing Python to interface with AutoIt bots and perform **remote code execution**.
- you could, if you wanted to, create a replacement for headers and perform remote code execution from python to resurrect old or broken bots.
- **Pathing Maps**:
- Integrated game-derived data determining walkable terrain and adjacency.
- Supports the creation of visual maps and advanced pathfinding algorithms.
- **Automatic Pathfinding**: Currently under development, with plans for seamless navigation and route optimization.

### Notes
- Pathing maps open opportunities for:
- Visualizing in-game terrain.
- Implementing complex pathfinding algorithms.
- Example use cases include dynamic navigation for bots and enhanced user interaction.

apoguita is offline  
Thanks
3 Users
Old 11/26/2024, 15:11   #12
 
elite*gold: 0
Join Date: Nov 2024
Posts: 10
Received Thanks: 1
upvoting this now that this might be our solution for 2025
markitosline is offline  
Thanks
1 User
Old 11/29/2024, 22:45   #13
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
�� Py4GW v1.0 - Public Release Changelog ��


---

Overview
�� Py4GW v1.0 is here! A lightweight standalone DLL built exclusively for Guild Wars scripting and automation. This version eliminates Toolbox dependency, delivering simplicity and performance for both experienced users and beginners alike.

---

✨ Key Features
- Standalone DLL:
��️ Direct injection, no external dependencies.
⚡ Efficient and reliable, custom-tailored for Guild Wars.

- Custom Functionality:
�� Tailored injection and standalone capabilities.
�� Minimal setup, easy to use.

- Python Integration:
�� Embedded Python for crafting advanced bot scripts.
�� Game-specific modules for seamless interaction.

---

�� What's New
1. Performance Optimization:
⚡ Faster execution, reduced resource usage.
�� Lightweight and focused.

2. User-Friendly Design:
�� Simplified injection process.
�� Accessible for all skill levels.

3. Focused Functionality:
��️ Designed to replace Toolbox with a custom-built solution.

---

�� Get Involved
�� Your feedback matters! Whether you're a seasoned scripter or just starting, your ideas and suggestions are invaluable to improving Py4GW.

Ways to contribute:
✔️ Share ideas for new features.
✔️ Report any issues or unexpected behavior.
✔️ Suggest enhancements to existing functionality.


---

�� Join the Community
Connect on Discord to:
�� Discuss features and share ideas.
�� Collaborate with others and get support.
�� Provide feedback and suggestions.

��

---

�� Acknowledgments
Special thanks to Greg for being instrumental in this library's development. Without his help, the issues wouldn't have been resolved this fast. His contributions are deeply appreciated.

---

Looking forward to your ideas and feedback. Welcome to the Py4GW community! ��
```
apoguita is offline  
Thanks
7 Users
Old 12/05/2024, 20:15   #14
 
elite*gold: 0
Join Date: May 2021
Posts: 282
Received Thanks: 268
For those wondering, we have a working library, there's no public bots yet, but many people are gathering.

If you're looking for an alternative library, this is the one (the only one working and being actively maintained)
apoguita is offline  
Thanks
1 User
Old 12/05/2024, 21:39   #15
 
elite*gold: 0
Join Date: Jul 2023
Posts: 147
Received Thanks: 147
Quote:
Originally Posted by apoguita View Post
For those wondering, we have a working library, there's no public bots yet, but many people are gathering.

If you're looking for an alternative library, this is the one (the only one working and being actively maintained)
You're making good progress on your project I see on the discord, I appreciate the work you do. I myself am just keeping up to date over there and trying to suck up information. Python and CPP is not my cup of tea but once it gets really rolling I hope to be able to experiment with it and possibly code something usable.
t7tcrusher is offline  
Reply

Tags
gwca, heroai, python, scripting, toolbox


Similar Threads Similar Threads
WTS Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys for sale
02/19/2013 - Guild Wars Trading - 4 Replies
Hi, i want to sell Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys.If someone is interested , you can email me and add my msn. We can talk details there. I will give u a low price of Guild Wars Gold,Guild Wars Ectos,Guild Wars Zaishen Keys including weapons. I am serious. Email:[email protected] MSN:[email protected] Thank you for reading my post.



All times are GMT +1. The time now is 22:14.


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.