GW1 Bots working in July 2017

03/31/2018 06:06 DHLight#1336
Quote:
Originally Posted by pontiac1979 View Post
the only bot that is working 100% for me is the ReFeather.
Kilroy also works.
03/31/2018 08:39 Underavelvetmoon#1337
Its because each bot comes with a vastly different GWA2 file that is normally modified by the author with custom functions. I assume you all just copied the new version to your folder and expected the bot to run. You either need to re-add the functions back, or download the old GWA2 from the bots on first page and update with file compare.

For example the Vaettir bot is written by Gigi, who is known to write many custom functions, so you cant just replace his GWA2 with an unmodified but updated GWA2. You need to go through and update the headers yourself or copy the functions he created over to the new one.

Anyway here is the UseSkillEx function if anyone needs it:

Code:
Func UseSkillEx($lSkill, $lTgt = -2, $aTimeout = 3000)
	If GetIsDead(-2) Then Return
	If Not IsRecharged($lSkill) Then Return

	Local $lDeadLock = TimerInit()
	UseSkill($lSkill, $lTgt)
	Do
		Sleep(50)
		If GetIsDead(-2) = 1 Then Return
	Until (Not IsRecharged($lSkill)) Or (TimerDiff($lDeadLock) > $aTimeout)
	Sleep(50)
EndFunc
03/31/2018 13:17 Jamamon#1338
Does anyone know what sort of packet/header the following might refer to?

Model: file '0x140e49' could not be opened (2)

It's where my GW is currently crashing.

Also, would someone please be able to list the functions that typically (or always) contain headers?

And, what do the parameters in the offset below refer to? Are any of them headers (I don't think so, but I'd like to make sure)?
Func startsalvage($aitem)
Local $loffset[4] = [0, 24, 44, 1580]
Local $lsalvagesessionid = memoryreadptr($mbasepointer, $loffset)

Thanks for all the help :)
03/31/2018 16:53 rheek#1339
Quote:
For example the Vaettir bot is written by Gigi, who is known to write many custom functions, so you cant just replace his GWA2 with an unmodified but updated GWA2. You need to go through and update the headers yourself or copy the functions he created over to the new one.
Also in the Vaettir Script by Gigi there are some functions that use SendPacket with old headers too. Make sure to update those too!


Quote:
Also, would someone please be able to list the functions that typically (or always) contain headers?
Ill give you a hint on how to find those functions yourself:
Code:
Func SendPacket($aSize, $aHeader, $aParam1 = 0, $aParam2 = 0, $aParam3 = 0, $aParam4 = 0, $aParam5 = 0, $aParam6 = 0, $aParam7 = 0, $aParam8 = 0, $aParam9 = 0, $aParam10 = 0)
This is from gwa2.au3. See the second parameter ($aHeader)?
Try searching inside gwa2.au3 for calls to "SendPacket" and look at what you see.

Quote:
Model: file '0x140e49' could not be opened (2)
It's where my GW is currently crashing.
That error does not say anything to me. The info you provided is rather useless as well. What program shows that message? What are you doing, which bot? At what exact spot does the error occur?

You might want to look for functions outside gwa2 that use outdated headers, like I mentioned above. I already gave you a hint on how to find the functions that use headers.

Quote:
And, what do the parameters in the offset below refer to? Are any of them headers (I don't think so, but I'd like to make sure)?
Func startsalvage($aitem)
Local $loffset[4] = [0, 24, 44, 1580]
Local $lsalvagesessionid = memoryreadptr($mbasepointer, $loffset)
No, they aren't headers. gwa2 scans the GW memory for a known pattern, which it saves as a base pointer. Everything else is addressed relatively from that basepointer. So the offset is difference of the positions in memory.
AFAIK those didnt change in the last update, so you can ignore them.


I really hate that the gwa2 devs implemented headers and offsets as magic numbers. That isnt exactly good programming style.

I made another file that contains all used headers as named variables and edited gwa2 to use those variables instead of the magic numbers. All headers in one file. Its way easier to update the headers as well.

I will share it with you guys soon, if there is interested in an easier to update version.
03/31/2018 19:42 tjubutsi#1340
That sounds like a neat idea, maybe you can work on that on github?
03/31/2018 20:55 pontiac1979#1341
Quote:
Originally Posted by Underavelvetmoon View Post
Its because each bot comes with a vastly different GWA2 file that is normally modified by the author with custom functions. I assume you all just copied the new version to your folder and expected the bot to run. You either need to re-add the functions back, or download the old GWA2 from the bots on first page and update with file compare.

For example the Vaettir bot is written by Gigi, who is known to write many custom functions, so you cant just replace his GWA2 with an unmodified but updated GWA2. You need to go through and update the headers yourself or copy the functions he created over to the new one.

Anyway here is the UseSkillEx function if anyone needs it:

Code:
Func UseSkillEx($lSkill, $lTgt = -2, $aTimeout = 3000)
	If GetIsDead(-2) Then Return
	If Not IsRecharged($lSkill) Then Return

	Local $lDeadLock = TimerInit()
	UseSkill($lSkill, $lTgt)
	Do
		Sleep(50)
		If GetIsDead(-2) = 1 Then Return
	Until (Not IsRecharged($lSkill)) Or (TimerDiff($lDeadLock) > $aTimeout)
	Sleep(50)
EndFunc
Hey, thanks for the info. Just to be clear, I'm using WinMerge since it is so simple. Am I correct in understanding that while comparing, I need to change the code in the new GWA2 to match the old GWA2? For instances where it is different, of course. I'm just making sure that I want to make the new GWA2 identical to the old.
03/31/2018 22:05 Jamamon#1342
Quote:
Originally Posted by pontiac1979 View Post
Hey, thanks for the info. Just to be clear, I'm using WinMerge since it is so simple. Am I correct in understanding that while comparing, I need to change the code in the new GWA2 to match the old GWA2? For instances where it is different, of course. I'm just making sure that I want to make the new GWA2 identical to the old.
Yeah, you do want most of the code from the old GWA2 to remain intact, since the script might be relying on a unique structure inside of it. My understanding is that all that needs to be updated are the headers.

There were two scripts in which I found it very easy to find the locations where the headers were being referred to, but a third is more complex, and is giving me a bit of trouble.

Quote:
Originally Posted by rheek View Post
That error does not say anything to me. The info you provided is rather useless as well. What program shows that message? What are you doing, which bot? At what exact spot does the error occur?

You might want to look for functions outside gwa2 that use outdated headers, like I mentioned above. I already gave you a hint on how to find the functions that use headers.
This is the part of the code that the script crashes at (War supply bot):

Func enterquest()
out("Entering Quest")
$npc = getnearestnpctocoords(-6753, 6513)
gotonpc($npc)
rndsleep(2000)
changeweaponset(4)
rndsleep(3000)
dialog(0x632)
waitmaploading($arrowexp)
rndsleep(3000)
EndFunc

As soon as the line "Entering Quest" is printed is when it crashes. This is shortly after enter HoM (after full load). I looked at all the functions being used immediately after that line, and I'm pretty sure I correctly updated whatever headers they were using. Can you think of any other obvious causes, such as some sort of sneakily hidden header reference?

I'm going to start fresh and go back through the entire script again, reupdating the headers.

I don't think this script is currently available on Epvpers, so maybe once I get it working I'll upload it.
04/01/2018 00:03 Underavelvetmoon#1343
Quote:
Originally Posted by Jamamon View Post
Yeah, you do want most of the code from the old GWA2 to remain intact, since the script might be relying on a unique structure inside of it. My understanding is that all that needs to be updated are the headers.

There were two scripts in which I found it very easy to find the locations where the headers were being referred to, but a third is more complex, and is giving me a bit of trouble.



This is the part of the code that the script crashes at (War supply bot):

Func enterquest()
out("Entering Quest")
$npc = getnearestnpctocoords(-6753, 6513)
gotonpc($npc)
rndsleep(2000)
changeweaponset(4)
rndsleep(3000)
dialog(0x632)
waitmaploading($arrowexp)
rndsleep(3000)
EndFunc

As soon as the line "Entering Quest" is printed is when it crashes. This is shortly after enter HoM (after full load). I looked at all the functions being used immediately after that line, and I'm pretty sure I correctly updated whatever headers they were using. Can you think of any other obvious causes, such as some sort of sneakily hidden header reference?

I'm going to start fresh and go back through the entire script again, reupdating the headers.

I don't think this script is currently available on Epvpers, so maybe once I get it working I'll upload it.
If it crashes after it moves to the NPC it's a problem with the dialog. If it crashes after loading the map then the headers are not updated correctly since that's one of the things that broke in the most recent upload. The code you linked looks sound so it is most likely your GWA2. I can double check my own script when I'm near the pc tomorrow. Might be a good incentive to do a rework lol
04/01/2018 02:49 rheek#1344
Quote:
Originally Posted by pontiac1979 View Post
Hey, thanks for the info. Just to be clear, I'm using WinMerge since it is so simple. Am I correct in understanding that while comparing, I need to change the code in the new GWA2 to match the old GWA2? For instances where it is different, of course. I'm just making sure that I want to make the new GWA2 identical to the old.
You only have to edit the headers in the old gwa2 file. Thats way less work than rewriting half of your new gwa2 file to match the behaviour of the old one.

Make sure you double check on weird lazy fixes. In one gwa2 I fixed the headers were incremented inside SendPacket. It had "$aHeader + 1". That was a lazy fix when headers were incremented by 1 sometime back. I set the headers to the actual values I grabbed from the packets, but the SendPacket always added 1 more to it. Always crashed until I found it...

Code:
$npc = getnearestnpctocoords(-6753, 6513)
gotonpc($npc)
These are the calls you need to look at. Add some debug output (Out("function + parameters")) and sleep after the matching function call for ~10s. That way you can rule one function out. Next do it again for the functions inside the function that causes the crash.

Inside those functions (standard gwa2 functions afaik) nothing seems to be hidden. Maybe take a look at the sendpacket function to rule out that you have the same +1 lazy hotfix as I described above.

If you dont get it to run, you can send me the source and Ill take a look at it.
04/01/2018 02:54 Jamamon#1345
Do you know what the difference in functionality is between

Func GetIsAttacking($aAgent = -2)

and

Func GetIsAttacking($aAgent)

Thanks in advance!
04/01/2018 03:17 rheek#1346
The first definition sets a standard value of -2 (that's your character) for the case you don't supply a value when calling the function. The parameter is optional in that case.

The second definition always expects you to call with a parameter.
04/01/2018 04:19 Jamamon#1347
Quote:
Originally Posted by rheek View Post
You only have to edit the headers in the old gwa2 file. Thats way less work than rewriting half of your new gwa2 file to match the behaviour of the old one.

Make sure you double check on weird lazy fixes. In one gwa2 I fixed the headers were incremented inside SendPacket. It had "$aHeader + 1". That was a lazy fix when headers were incremented by 1 sometime back. I set the headers to the actual values I grabbed from the packets, but the SendPacket always added 1 more to it. Always crashed until I found it...

Code:
$npc = getnearestnpctocoords(-6753, 6513)
gotonpc($npc)
These are the calls you need to look at. Add some debug output (Out("function + parameters")) and sleep after the matching function call for ~10s. That way you can rule one function out. Next do it again for the functions inside the function that causes the crash.

Inside those functions (standard gwa2 functions afaik) nothing seems to be hidden. Maybe take a look at the sendpacket function to rule out that you have the same +1 lazy hotfix as I described above.

If you dont get it to run, you can send me the source and Ill take a look at it.
This information is really helpful. It was like a breakthrough for me in terms of improving my script editing abilities. Got it to run in no time.

You're awesome! :)
04/01/2018 04:43 pontiac1979#1348
Quote:
Originally Posted by rheek View Post
You only have to edit the headers in the old gwa2 file. Thats way less work than rewriting half of your new gwa2 file to match the behaviour of the old one.

Make sure you double check on weird lazy fixes. In one gwa2 I fixed the headers were incremented inside SendPacket. It had "$aHeader + 1". That was a lazy fix when headers were incremented by 1 sometime back. I set the headers to the actual values I grabbed from the packets, but the SendPacket always added 1 more to it. Always crashed until I found it...

Code:
$npc = getnearestnpctocoords(-6753, 6513)
gotonpc($npc)
These are the calls you need to look at. Add some debug output (Out("function + parameters")) and sleep after the matching function call for ~10s. That way you can rule one function out. Next do it again for the functions inside the function that causes the crash.

Inside those functions (standard gwa2 functions afaik) nothing seems to be hidden. Maybe take a look at the sendpacket function to rule out that you have the same +1 lazy hotfix as I described above.

If you dont get it to run, you can send me the source and Ill take a look at it.
The bot I'm taking a look at right now is the vaettir 2 script located on the first page. I see that in the old script, there is code for "WinList" while in the new script, it is "ProcessList". I assume I don't need to change that? Otherwise it's gonna take me a while to get through that, lol. Any chance you could tell me what to look for in that script? I want to fix it myself but I don't really know where to start.

Thanks

edit: actually, I think I'm onto something now. I shall return to update later.

I got the vaettir fix 2 working. However, it told me that the code on line 3319 was a duplicate function so I just deleted it. I've been watching the bot attempt to run to the vaettirs but it keeps walking directly toward and dying on the first mob outside longeye's. I'm pasting the code below, because I'm not sure how it would affect anything.

Func SetDisplayedTitle($aTitle = 0)
If $aTitle Then
Return SendPacket(0x8, 0x50, $aTitle)
Else
Return SendPacket(0x4, 0x51)
EndIf
EndFunc ;==>SetDisplayedTitle
04/01/2018 06:30 fivel_976#1349
the only bot i run is kilroys and for the past week or so every time i try to start the bot my game just crashes is this do to a game update or is it becuse i updated windows for the first time in many years? my bot files are old from 2014 thay were working just fine up till a week or so ago. does anyone have a working kilroys and updated gwa2 i could download please
04/01/2018 07:55 pontiac1979#1350
Quote:
Originally Posted by fivel_976 View Post
the only bot i run is kilroys and for the past week or so every time i try to start the bot my game just crashes is this do to a game update or is it becuse i updated windows for the first time in many years? my bot files are old from 2014 thay were working just fine up till a week or so ago. does anyone have a working kilroys and updated gwa2 i could download please
Have you not read any part of this thread or the other 2 made about it.. like at all?