ToCbot issue (i'm a coding noob)

04/07/2018 14:57 aimlesschibbi#1
I have no idea what to do actually, yes i'm more of a leecher.
I tried learning how to code but i just can't understand any of it.

Please take a look at the files attached. I included the GWA2, GWA2 headers, ToCbot and the Gwa_Missing_headers textfile.

(Guildwars crash when the bot tries to use a FoW scroll)

I hope some of you can give me some advice on what to do and how to do it.
My thanks in advance,

This is where i think the issue is. (gwa_missing_headers.txt)
Quote:
C:\Users\ToC Botv2.1.au3 (521):
C:\Users\ToC Botv2.1.au3 (522): Func UseItembyModelID($amodelid)
C:\Users\ToC Botv2.1.au3 (523): Local $lItem
C:\Users\ToC Botv2.1.au3 (524): For $lbag = 1 To 4
C:\Users\ToC Botv2.1.au3 (525): For $lslot = 1 To $bag_slots[$lbag]
C:\Users\ToC Botv2.1.au3 (526): $lItem = getitembyslot($lbag, $lslot)
C:\Users\ToC Botv2.1.au3 (527): If DllStructGetData($lItem, "ModelID") == $amodelid Then Return sendpacket(8, 119, DllStructGetData($lItem, "ID"))
C:\Users\ToC Botv2.1.au3 (528): Next
C:\Users\ToC Botv2.1.au3 (529): Next
C:\Users\ToC Botv2.1.au3 (530): Return False
C:\Users\ToC Botv2.1.au3 (531): EndFunc ;==>useitembymodelid
04/07/2018 15:57 DerMoench14#2
Inside Toc Botv2.1.au3:

Replace Line 291
Code:
Return sendpacket(8, $HEADER_ITEM_USE, DllStructGetData($item, "ID"))
with
Code:
UseItem(DllStructGetData($item, "ID"))
Replace Line 527
Code:
If DllStructGetData($lItem, "ModelID") == $amodelid Then Return sendpacket(8, 119, DllStructGetData($lItem, "ID"))
with
Code:
If DllStructGetData($lItem, "ModelID") = $amodelid Then UseItem(DllStructGetData($$lItem, "ID"))
04/10/2018 22:59 rheek#3
Quote:
Originally Posted by aimlesschibbi View Post
Please take a look at the files attached. I included the GWA2, GWA2 headers, ToCbot and the Gwa_Missing_headers textfile.

(Guildwars crash when the bot tries to use a FoW scroll)
Perfect example for the kind of information I asked for. Thanks for supplying all the files I asked for. This really makes helping way easier :D

Quote:
Originally Posted by DerMoench14 View Post
Inside Toc Botv2.1.au3:

Replace Line 291
Code:
Return sendpacket(8, $HEADER_ITEM_USE, DllStructGetData($item, "ID"))
with
Code:
UseItem(DllStructGetData($item, "ID"))
Replace Line 527
Code:
If DllStructGetData($lItem, "ModelID") == $amodelid Then Return sendpacket(8, 119, DllStructGetData($lItem, "ID"))
with
Code:
If DllStructGetData($lItem, "ModelID") = $amodelid Then UseItem(DllStructGetData($$lItem, "ID"))
That looks like a working fix.

Other than having all calls to sendpacket inside gwa2 this way, this does not look to be any different than replacing the 119 by $HEADER_ITEM_USE. All UseItem does is getting the ID the same way its done in the snippets and then it calls sendpacket with the exact same parameters.

Or do I miss sth?

Just asking so I can fix it in the patcher correctly.
04/10/2018 23:24 aimlesschibbi#4
Quote:
Originally Posted by rheek View Post
Perfect example for the kind of information I asked for. Thanks for supplying all the files I asked for. This really makes helping way easier :D



That looks like a working fix.

Other than having all calls to sendpacket inside gwa2 this way, this does not look to be any different than replacing the 119 by $HEADER_ITEM_USE. All UseItem does is getting the ID the same way its done in the snippets and then it calls sendpacket with the exact same parameters.

Or do I miss sth?

Just asking so I can fix it in the patcher correctly.
It is a working fix, the bot runs and does its job perfectly again!
Would be nice for others if you could add this to the patcher.
I do not have the knowledge to answer your question other than that the fix worked.