Register for your free account! | Forgot your password?

You last visited: Today at 01:28

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

Advertisement



Salvaging with GWCA

Discussion on Salvaging with GWCA within the GW Exploits, Hacks, Bots, Tools & Macros forum part of the Guild Wars category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2017
Posts: 11
Received Thanks: 5
Salvaging with GWCA

I tried implementing a salvage tool in GWCA, but i guess it doesn't really support it. Does anyone know how to start a salvage with it? Should it work with a packet?
havochavoc2 is offline  
Old 02/02/2020, 04:20   #2
 
elite*gold: 0
Join Date: Jul 2019
Posts: 103
Received Thanks: 83
So the general flow is something like this:

check loading for in town, explorable, or loading screen

White or blacklist of items you want to salvage

Confirm player is alive

base ptr->player->bag->slot to get info such as modelid for the target salvage and if stackable, this means iterate over the bags and slots

Follow that same pointer chain to find if you have the specific salvage kit you want to use and get the data, this means iterate over the bags and slots

Record the location of salvage kit and item you want to salvage in a struct or other method.

start a salvage session from the local client function

make sure the item based on the previous iterations isn't null

then take the packet header, item ID, Salvagekit ID, and salvage session ID and send a packet with the header indicating a salvage with that data.
list comprehension is offline  
Old 02/02/2020, 18:19   #3
 
elite*gold: 0
Join Date: Sep 2017
Posts: 11
Received Thanks: 5
Thanks for the help!

Quote:
Originally Posted by list comprehension View Post

start a salvage session from the local client function
I think this is what's missing but I don't know how to get the function. With a pattern i guess?

This is what I have at the moment, it kicks you to the character select screen. The problem is definately the first packet.

Code:
void SalvageForMaterials(GW::Item* item) {
    if (item == nullptr) return;
    GW::Item* salvage_kit = GW::Items::GetItemByModelId(2992);
    if (salvage_kit == NULL) return;
    uint32_t salvage_session_id = GW::GameContext::instance()->world->salvage_session_id;
    uint32_t salvage_kit_id = salvage_kit->item_id;
    uint32_t item_id = item->item_id;
    GW::GameThread::Enqueue([item_id, salvage_kit_id, salvage_session_id] {GW::CtoS::SendPacket(0x10, 0x7D, item_id, salvage_kit_id, salvage_session_id);});
    RndSleep(500);
    if (GetRarity(item) == RARITY_GOLD || GetRarity(item) == RARITY_PURPLE) {
        GW::GameThread::Enqueue([] {GW::CtoS::SendPacket(0x4, 0x80);});
        RndSleep(1000);
    }
}
havochavoc2 is offline  
Old 02/03/2020, 08:41   #4
 
3vangelist's Avatar
 
elite*gold: 0
Join Date: Jan 2018
Posts: 46
Received Thanks: 14
GWA2's salvage function hooked into a method that does more than just send the packet as you're doing here. GWCA doesn't have this method hooked because none of the projects that depend on it use automated salvaging.

Also your packet content is in the wrong order, 500ms won't guarantee a response, 1000ms won't guarantee your salvage is complete, and blue items may also have upgrades to salvage.
3vangelist is offline  
Old 02/07/2020, 23:42   #5
 
Zvend's Avatar
 
elite*gold: 143
Join Date: Oct 2011
Posts: 72
Received Thanks: 31
as 3vangelist said. GWA2 hooks a function. with c++ u can call the function directly. so u dont need a hook. u just need to care about a few things. u will need 2 patterns to be able to do so.

u will probably get kicked with code 007 or get a crash when u send a salvage packet for a weapon. thats why some items can be salvaged only into materials.
For weapons u get a packet back from the Gameserver, which contains the the array of the mods.
So if you send the salvage packet for a weapon, then u get some packets back, where ur client cannot handle it, bcs it was not prepared for the incoming packets.
you will need to prepare a few things clientside before sending the final packet for weapon salvaging. Thats why GWA2 hooked the function, which also sends the right packet. There is a workaround for that where u block the incoming packets and just send the salvage packet. but thats nasty and will only update the inventory when changing the map and will also probably crash when the bot tries to do sth with the item or the invisible items u got through the salvage.

Quote:
Also your packet content is in the wrong order, 500ms won't guarantee a response, 1000ms won't guarantee your salvage is complete, and blue items may also have upgrades to salvage.
you will probably want to wait for the incoming packet which tells ur client that u successfully salvaged. so working with GStoC is probably ur way to go too.
Zvend is offline  
Old 02/08/2020, 20:04   #6
 
phat34's Avatar
 
elite*gold: 0
Join Date: Sep 2014
Posts: 354
Received Thanks: 120
they obviously want to get salvaging working with something so they can get it fixed in gwa2... not a bad plan!
phat34 is offline  
Reply


Similar Threads Similar Threads
GWCA goes Open Source
12/24/2018 - GW Exploits, Hacks, Bots, Tools & Macros - 135 Replies
Hey, My project GWCA, short for Guild Wars Client API, has now been released as Open Source! You may find it on GoogleCode: GWCA on GoogleCode You'll find possibly everything you need there, but if you're still uncertain about something there's a link to a place, where you can ask questions, on the front page of the project!



All times are GMT +1. The time now is 01:28.


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.