@
[Only registered and activated users can see links. Click Here To Register...] - Alright that is an interesting thought, it looks like the loot is right beside me and also its not crashing the GW client only the Autoit program, not sure if that makes a difference. Thank you so much for your input!
@
[Only registered and activated users can see links. Click Here To Register...] - I will try that bit of code and see if it works! Also thank you so much for taking the time to help me out! :):feelsgoodman:
@
[Only registered and activated users can see links. Click Here To Register...] - It looks like my GWA2 was missing the PickUpLoot function!!!!!!
It is now picking up the items! Thanks!
Im going to be working on the Merchant/Sell functions now to try and get this bot 100% working and I will reupload for everyone! thanks again!
Okay, I have run the bot a few times, and it is picking up correctly and traveling without any problems.
Once the bot sees I have less than 4 or 5 slots (I forget how many exactly) travels to GH to talk to the merchant. I have been using the Out("Made it this Far") to try and pinpoint where the issue is happening. :p
Looks like I'm having an issue inside this section
PHP Code:
Func Merchant()
Dim $Waypoints_by_Merchant[29][3] = [ _
[$BurningIsle, -4439, -2088], _
[$BurningIsle, -4772, -362], _
[$BurningIsle, -3637, 1088], _
[$BurningIsle, -2506, 988], _
[$DruidsIsle, -2037, 2964], _
[$FrozenIsle, 99, 2660], _
[$FrozenIsle, 71, 834], _
[$FrozenIsle, -299, 79], _
[$HuntersIsle, 5156, 7789], _
[$HuntersIsle, 4416, 5656], _
[$IsleOfTheDead, -4066, -1203], _
[$NomadsIsle, 5129, 4748], _
[$WarriorsIsle, 4159, 8540], _
[$WarriorsIsle, 5575, 9054], _
[$WizardsIsle, 4288, 8263], _
[$WizardsIsle, 3583, 9040], _
[$ImperialIsle, 1415, 12448], _
[$ImperialIsle, 1746, 11516], _
[$IsleOfJade, 8825, 3384], _
[$IsleOfJade, 10142, 3116], _
[$IsleOfMeditation, -331, 8084], _
[$IsleOfMeditation, -1745, 8681], _
[$IsleOfMeditation, -2197, 8076], _
[$IsleOfWeepingStone, -3095, 8535], _
[$IsleOfWeepingStone, -3988, 7588], _
[$CorruptedIsle, -4670, 5630], _
[$IsleOfSolitude, 2970, 1532], _
[$IsleOfWurms, 8284, 3578], _
[$UnchartedIsle, 1503, -2830]]
For $i = 0 To (UBound($Waypoints_by_Merchant) - 1)
If ($Waypoints_by_Merchant[$i][0] == True) Then
Do
GenericRandomPath($Waypoints_by_Merchant[$i][1], $Waypoints_by_Merchant[$i][2], Random(60, 80, 2))
Until CheckArea($Waypoints_by_Merchant[$i][1], $Waypoints_by_Merchant[$i][2])
EndIf
Next
Out("Going to Merchant")
Do
RndSleep(Random(250,500))
Local $Me = GetAgentByID(-2)
Out("Made it this far")
Local $guy = GetNearestNPCToCoords(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'))
Until DllStructGetData($guy, 'Id') <> 0
ChangeTarget($guy)
RndSleep(Random(250,500))
GoNPC($guy)
RndSleep(Random(250,500))
Do
MoveTo(DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y'), 40)
RndSleep(Random(500,750))
GoNPC($guy)
RndSleep(Random(250,500))
Local $Me = GetAgentByID(-2)
Until ComputeDistance(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'), DllStructGetData($guy, 'X'), DllStructGetData($guy, 'Y')) < 250
RndSleep(Random(1000,1500))
EndFunc ;~ Merchant
So I'm looking over at the GWA2 and my header that I believe it is using is
PHP Code:
Global Const $HEADER_NPC_TALK = 0x3F
And GWA2 is using the Function GetNearestNPCToCoords() below
PHP Code:
Func GetNearestNPCToCoords($aX, $aY)
Local $lNearestAgent, $lNearestDistance = 100000000
Local $lDistance
Local $lAgentArray = GetAgentArray(0xDB)
For $i = 1 To $lAgentArray[0]
If DllStructGetData($lAgentArray[$i], 'Allegiance') <> 6 Then ContinueLoop
If DllStructGetData($lAgentArray[$i], 'HP') <= 0 Then ContinueLoop
If BitAND(DllStructGetData($lAgentArray[$i], 'Effects'), 0x0010) > 0 Then ContinueLoop
$lDistance = ($aX - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + ($aY - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
If $lDistance < $lNearestDistance Then
$lNearestAgent = $lAgentArray[$i]
$lNearestDistance = $lDistance
EndIf
Next
SetExtended(Sqrt($lNearestDistance))
Return $lNearestAgent
EndFunc ;==>GetNearestNPCToCoords
I tried changing the Header but it appears that the header is correct as the merchant is being highlighted?