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
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:
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.
Ill give you a hint on how to find those functions yourself:Quote:
Also, would someone please be able to list the functions that typically (or always) contain headers?
Func SendPacket($aSize, $aHeader, $aParam1 = 0, $aParam2 = 0, $aParam3 = 0, $aParam4 = 0, $aParam5 = 0, $aParam6 = 0, $aParam7 = 0, $aParam8 = 0, $aParam9 = 0, $aParam10 = 0)
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?Quote:
Model: file '0x140e49' could not be opened (2)
It's where my GW is currently crashing.
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.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)
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.Quote:
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
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.Quote:
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.
This is the part of the code that the script crashes at (War supply bot):Quote:
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.
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 lolQuote:
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.
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.Quote:
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.
$npc = getnearestnpctocoords(-6753, 6513) gotonpc($npc)
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.Quote:
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...
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.Code:$npc = getnearestnpctocoords(-6753, 6513) gotonpc($npc)
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.Quote:
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...
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.Code:$npc = getnearestnpctocoords(-6753, 6513) gotonpc($npc)
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.
Have you not read any part of this thread or the other 2 made about it.. like at all?Quote:
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