[GWA2] How to close salvage window AFTER salvage session is complete?

05/07/2018 20:04 3vangelist#1
Hi all,

I'm making a bot to manage my inventory for me in-game.

1. StartSalvage() on an item I want a mod for.
2. SalvageMod() for the mod I'm after
3. Close Salvage window (without GW kicking me out!)

Can't figure out how to do step 3. Looks like when I close the salvage window in-game, it sends a packet to the GS to "cancel" the session. The GS panics when it sees that the session has already completed, and the client gets kicked from the server.

Help or examples would be really appreciated. Thanks :)
05/07/2018 20:33 savsuds#2
I believe that 4D 1 solved this by creating _GuildWars_SendEvent() and placed it inside SalvageMod() in gwaX.

Most people that have been salvaging mods have just ignored the window and know not to attempt to close it manually.

It is just best to skip step 3. It doesn't help the bot perform better.
05/07/2018 20:44 3vangelist#3
Thanks for the info. This isn't anywhere in the version of gwapi or gwa2 I have so I'm guessing this. Is another library. Do you know where I can find it?
05/07/2018 21:32 savsuds#4
The simple answer is yes, I know where to find it. The real answer is that gwaX API is not a public release.

Code:
;~ Description:  Salvages a mod from an item.  $nType = { $SALVAGE_PREFIX(0), $SALVAGE_SUFFIX(1), $SALVAGE_INSCRIPTION(2) }
Func _GuildWars_SalvageMod($nType)
    Local $tQueueBuff = DllStructCreate("DWORD;DWORD;DWORD;DWORD")

    DllStructSetData($tQueueBuff, 1, $CMD_SEND_PACKET)
    DllStructSetData($tQueueBuff, 2, 0x0008          )
    DllStructSetData($tQueueBuff, 3, $CtoGS_MSGSalvageMod          )
    DllStructSetData($tQueueBuff, 4, $nType          )

	_GuildWars_SendEvent(0xFB,0,0)

    Return __Enqueue($tQueueBuff, 16)
EndFunc
Maybe that will help you out.
05/07/2018 21:46 DerMoench14#5
It won't ... because he doesn't have the lib.
Sry but gwaX is private and most probably it will also stay private.

But you can just ignore the open window that keeps open after salvage. It will disappear after mapchange.
You can also klick "cancel" manually ... just don't klick on "salvage" because it will crash the client.
05/08/2018 03:41 3vangelist#6
Thanks for the replies, at least I know it can be done, I'll keep digging