GW Working Bots 2020

05/03/2021 22:18 OneStrangeGuy#1876
If i'm not wrong that func returns an array, maybe you are making a wrong use of the values?
05/04/2021 13:18 FriendlyFarmer#1877
Quote:
Originally Posted by ottam View Post
Is there something wrong with this function?

It is crashing the game.

Func GetNearestEnemyToAgent($aAgent = -2)
Local $lNearestAgent, $lNearestDistance = 100000000
Local $lDistance
Local $lAgentArray = GetAgentArray(0xDB)

If Not IsDllStruct($aAgent) Then $aAgent = GetAgentByID($aAgent)

Local $lID = DllStructGetData($aAgent, 'ID')

For $i = 1 To $lAgentArray[0]
$lDistance = (DllStructGetData($aAgent, 'X') - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + (DllStructGetData($aAgent, 'Y') - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
If DllStructGetData($lAgentArray[$i], 'Allegiance') <> 3 Then ContinueLoop
If DllStructGetData($lAgentArray[$i], 'HP') <= 0 Then ContinueLoop
If BitAND(DllStructGetData($lAgentArray[$i], 'Effects'), 0x0010) > 0 Then ContinueLoop

$lDistance = (DllStructGetData($aAgent, 'X') - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + (DllStructGetData($aAgent, 'Y') - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
If $lDistance < $lNearestDistance Then
If DllStructGetData($lAgentArray[$i], 'ID') == $lID Then ContinueLoop
$lNearestAgent = $lAgentArray[$i]
$lNearestDistance = $lDistance
EndIf
Next

SetExtended(Sqrt($lNearestDistance))
Return $lNearestAgent
EndFunc ;==>GetNearestEnemyToAgent
Why are you so certain that this function crashes the game? Maybe one of the functions that calls this one is trying to perform illegal actions, hence the game crashing.
What errors do you get, which part of your code actually crashes the game?
05/05/2021 16:13 YueNiu#1878
Quote:
Originally Posted by ottam View Post
Is there something wrong with this function?

It is crashing the game.

Func GetNearestEnemyToAgent($aAgent = -2)
Local $lNearestAgent, $lNearestDistance = 100000000
Local $lDistance
Local $lAgentArray = GetAgentArray(0xDB)

If Not IsDllStruct($aAgent) Then $aAgent = GetAgentByID($aAgent)

Local $lID = DllStructGetData($aAgent, 'ID')

For $i = 1 To $lAgentArray[0]
$lDistance = (DllStructGetData($aAgent, 'X') - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + (DllStructGetData($aAgent, 'Y') - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
If DllStructGetData($lAgentArray[$i], 'Allegiance') <> 3 Then ContinueLoop
If DllStructGetData($lAgentArray[$i], 'HP') <= 0 Then ContinueLoop
If BitAND(DllStructGetData($lAgentArray[$i], 'Effects'), 0x0010) > 0 Then ContinueLoop

$lDistance = (DllStructGetData($aAgent, 'X') - DllStructGetData($lAgentArray[$i], 'X')) ^ 2 + (DllStructGetData($aAgent, 'Y') - DllStructGetData($lAgentArray[$i], 'Y')) ^ 2
If $lDistance < $lNearestDistance Then
If DllStructGetData($lAgentArray[$i], 'ID') == $lID Then ContinueLoop
$lNearestAgent = $lAgentArray[$i]
$lNearestDistance = $lDistance
EndIf
Next

SetExtended(Sqrt($lNearestDistance))
Return $lNearestAgent
EndFunc ;==>GetNearestEnemyToAgent
If i am not mistaken, this function and toolbox don't go well together and cause a crash.
05/06/2021 06:48 epvp_dragon#1879
Quote:
Originally Posted by list comprehension View Post
I added a write up on pattern scanning updates as previously stated:
[Only registered and activated users can see links. Click Here To Register...]
I tried following your guide to find patterns to update the GWA2 for certain functions to work but have been unsuccessful. I even used the exact pattern you showed as an example for ScanTraderFunction and it just keeps erroring and closing the GW client. I even updated some of the patterns that yoshikawa helped me out with but that errors out my guild wars client as well.

Has anyone else had any luck updating this or does someone have a working, updated GWA2 already?
05/07/2021 21:01 The Sav3r#1880
anyone can help me with a func that detect if all party is dead?
05/07/2021 22:56 CookiesCream#1881
Moin Leute...

Da mein Englisch eine mittelschwere Katastrophe ist, bin ich leider gezwungen hier mal auf deutsch zu fragen.

Was ich geschnallt habe:
- alte Bots funktionieren nicht mehr, da ein Update alles kaputt gemacht hat
- man Braucht die neue GWA2.au3
- man Braucht die GWA2_Headers.au3
- man muss in die alten "Scripts" #include GWA2_Headers.au3

Was ich überhaupt nicht gerafft habe:

- die Option "Func PickUpLoot" und weshalb sie nicht mehr geht...
- welshalb mein Sunspearbot abschmiert, sobald der Wurm benutzt wird etc...

Vieleicht hat ja jemand mal Zeit und Lust mir dem Kram etwas zu erklären und näher zu bringen.

LG
05/08/2021 00:56 OneStrangeGuy#1882
Quote:
Originally Posted by The Sav3r View Post
anyone can help me with a func that detect if all party is dead?
Modify this Func to your needs:

Code:
Func CheckPartyDead()
	$DeadParty = 0
	For $i =1 to GetHeroCount()
		If GetIsDead(GetHeroID($i)) = True Then
			$DeadParty +=1
		EndIf
		If $DeadParty >= 6 Then
			$DeadOnTheRun = 1
			CurrentAction("We Wipe, going back oupost to save time")
		EndIf
	Next
EndFunc
05/08/2021 01:13 monsterzone93#1883
Hi Guys,
I always get this message when I start the new GWA2.
"Line 1505 (File" C: \ .... kilroy \ GWA2.au3 "):

Return SendPacket (0x18, $ HEADER_MAP_TRAVEL, $ aMapID,
$ aRegion, $ aDistrict, $ aLanguage, False)
Return SendPacket (0x18, ^ ERROR

Error: Variable used without beeing declared "

I tried to declare the variable, but the game crashes. The command looks like this "Global Const $ HEADER_MAP_TRAVEL = 0x18"

What did I do wrong?
05/08/2021 01:40 DerMoench14#1884
Delete the Space between $ and H.
05/08/2021 12:03 zer0.de#1885
Quote:
Originally Posted by CookiesCream View Post
Moin Leute...

Da mein Englisch eine mittelschwere Katastrophe ist, bin ich leider gezwungen hier mal auf deutsch zu fragen.

Was ich geschnallt habe:
- alte Bots funktionieren nicht mehr, da ein Update alles kaputt gemacht hat
- man Braucht die neue GWA2.au3
- man Braucht die GWA2_Headers.au3
- man muss in die alten "Scripts" #include GWA2_Headers.au3

Was ich überhaupt nicht gerafft habe:

- die Option "Func PickUpLoot" und weshalb sie nicht mehr geht...
- welshalb mein Sunspearbot abschmiert, sobald der Wurm benutzt wird etc...

Vieleicht hat ja jemand mal Zeit und Lust mir dem Kram etwas zu erklären und näher zu bringen.

LG
die Func PickUpLoot funktioniert eigentlich, was nicht klappt ohne dirtyfix ist das verkaufen.

Das der skill nicht funkt, kann natürlich an den headers liegen.
ich habe imo auch das problem, dass bei annahme von Questen GW abschmiert ohne error - das erschwärt die fehler suche ...

hier mal meine func:

PHP Code:
Func PickUpLoot()
    
Local $lMe
    Local $lBlockedTimer
    Local $lBlockedCount 
= 0
    Local $lItemExists 
= True

    
For $i = 1 To GetMaxAgents()
        
$lAgent = GetAgentByID($i)
        If (
CountFreeSlots()=0) Then Return False
        
If Not (GetIsMovable($lAgent)) Then ContinueLoop
        
If Not (GetCanPickUp($lAgent)) Then ContinueLoop
        $lItem 
= GetItemByAgentID($i)
        If (
CanPickUp2($lItem)) Then ;hier mal prüfen ob die Function vorhanden ist, ansonsten anpassen
            
Do
                If (
GetDistance($lItem) > 150) Then Move(DllStructGetData($lItem, 'X'), DllStructGetData($lItem, 'Y'))
                
PickUpItem($lItem)
                
Sleep(GetPing())
                Do
                    If (
GetIsDead(-2)) Then Return False
                    Sleep
(100)
                    
$lMe = GetAgentByID(-2)
                
Until ((DllStructGetData($lMe, 'MoveX') == 0) AND (DllStructGetData($lMe, 'MoveY') == 0))
                
$lBlockedTimer = TimerInit()
                Do
                    If (
GetIsDead(-2)) Then Return False
                    Sleep
(3)
                    
$lItemExists = IsDllStruct(GetAgentByID($i))
                
Until Not ($lItemExists) OR (TimerDiff($lBlockedTimer) > Random(5000, 7500, 1))
                If 
$lItemExists Then $lBlockedCount += 1
            Until Not $lItemExists 
OR $lBlockedCount > 5
        
EndIf
    
Next
EndFunc   
;==>PickUpLoot 
05/09/2021 04:34 markgw3#1886
I'm writing a bot for Auto ST player, where while in combat, I want to use the Displacement, Shelter ... Question, how can I check if I have a certain buff so I don't spam it if the skill is available? Is there a function to check buff on another player/hero also for weapon spells?
05/09/2021 12:04 OneStrangeGuy#1887
Quote:
Originally Posted by markgw3 View Post
I'm writing a bot for Auto ST player, where while in combat, I want to use the Displacement, Shelter ... Question, how can I check if I have a certain buff so I don't spam it if the skill is available? Is there a function to check buff on another player/hero also for weapon spells?
Your GWA2 should have the GetEffect Func, use something like this to see if your target has a specific buff. :mofo:

Code:
Func HasEffect($aEffectSkillID)
   If DllStructGetData(GetEffect($aEffectSkillID), "SkillID") == 0 Then
	  Return False
   Else
	  Return True
   EndIf
EndFunc
05/09/2021 12:12 Kn!ckl3s#1888
Is there a way to post all functional bots in one thread? or maybe start a new topic with bots 2021?
05/09/2021 17:36 Paki29#1889
Hi guys,

I'm having trouble fixing the Follower Bot. I managed to fix the following fonction, but I face difficulties with the Attack fonction. The second account only cast their first spell of the skillbar.

PHP Code:
Func Attack($x, $s = "enemies")
    
local $TimerToGetOut = TimerInit()
    Do
        
$useSkill = -1
        $target 
= GetNearestEnemyToAgent(-2)
        
$distance = GetDistance($target, -2)
        If 
DllStructGetData($target, 'ID') <> 0 AND $distance < $x Then
            ChangeTarget
($target)
            
Sleep(150)
            
CallTarget($target)
            
Sleep(150)
            
Attack($target)
            
Sleep(150)
        ElseIf 
DllStructGetData($target, 'ID') = 0 OR $distance > $x Then
            exitloop
        
EndIf

        For 
$i = 0 To 8

            $targetHP 
= DllStructGetData(GetCurrentTarget(),'HP')
            if 
$targetHP = 0 then ExitLoop

            $distance 
= GetDistance($target, -2)
            if 
$distance > $x then ExitLoop

            $TargetAllegiance 
= DllStructGetData(GetCurrentTarget(),'Allegiance')
            if 
$TargetAllegiance = 0x1 OR $TargetAllegiance = 0x4 OR $TargetAllegiance = 0x5 OR $TargetAllegiance = 0x6 Then ExitLoop

            $TargetIsDead 
= DllStructGetData(GetCurrentTarget(), 'Effects')
            If 
$TargetIsDead = 0x0010 Then ExitLoop

            $TargetItem 
= DllStructGetData(GetCurrentTarget(),'Type')
            if 
$TargetItem = 0x400 then ExitLoop

            $energy 
= GetEnergy(-2)
            
$recharge = DllStructGetData(GetSkillBar(), "Recharge" & $i+1)
            
$adrenaline = DllStructGetData(GetSkillBar(), "Adrenaline" & $i+1)


Local $Energy = StringReplace(StringReplace(StringReplace(StringMid(DllStructGetData($useskill, 'Unknown4'), 6, 1), 'C', '25'), 'B', '15'), 'A', '10')
            If 
$recharge = 0 Then
                $useSkill 
= $i + 1
                $variabletosort 
= 0
                UseSkill
($useSkill, $target)
                
Sleep(200)
            EndIf
            
$target = GetNearestEnemyToAgent(-2)
            
Attack($target)
            
Sleep(150)
            if 
$i = 8 then $i = -1 ; change -1
        Next

        $TargetAllegiance 
= DllStructGetData(GetCurrentTarget(),'Allegiance')
        
$TargetIsDead = DllStructGetData(GetCurrentTarget(), 'Effects')
        
$targetHP = DllStructGetData(GetCurrentTarget(),'HP')
        
$TargetItem = DllStructGetData(GetCurrentTarget(),'Type')
    
Until DllStructGetData($target, 'ID') = 0 OR $distance > $x OR $TargetAllegiance = 0x1 OR $TargetAllegiance = 0x4 OR $TargetAllegiance = 0x5 OR $TargetAllegiance = 0x6 OR $TargetIsDead = 0x0010 OR $targetHP = 0 OR $TargetItem = 0x400 OR TimerDiff($TimerToGetOut) > 240000
EndFunc 
Btw, I'm a beginner with code, so don't judge me if you think the changes I made are not optimized :)
05/10/2021 08:04 markgw3#1890
Quote:
Originally Posted by OneStrangeGuy View Post
Your GWA2 should have the GetEffect Func, use something like this to see if your target has a specific buff. :mofo:

Code:
Func HasEffect($aEffectSkillID)
   If DllStructGetData(GetEffect($aEffectSkillID), "SkillID") == 0 Then
	  Return False
   Else
	  Return True
   EndIf
EndFunc
Got it, I think my GetEffect is busted. It returns False when the spirit is alive, but for Shelter, it just keeps spamming it. Do you call TargetSelf() before using this? It seems GetEffect targets self already since $aHeroNumber = 0, which I am assuming the player itself. I think my GWA2 might be super outdated, would you mind sharing me yours I can probably figure out what the problem on my end. From what I read, it's suppose to return to me an array or struct, but what to do with that array lol I have no idea. My console keeps saying Shelter doesn't exist, but Displacement and Union do and doesn't get casted, Shelter on the other hand keeps getting spammed. I'm very close though! Appreciate all your help :handsdown:

I've only been writing my own bots for a little bit so I'm getting used to fixing certain functions.