OK to ask for exploit/Scripting help here...

10/22/2019 05:57 phat34#181
longer sleeps and not just random ones... u need a getping style sleep. Also for different items there are different salvage recipes so look in a bot that does salvaging already and follow those methods.
10/22/2019 18:36 klaus trash#182
Hey guys, i am working on some Nickset.Bot stuff. And i want to farm Devourers, which spawn from the ground if you are near by. I dont know why, but my bot (with other enemies there is no problem) just keeps running without killing the spawned devourers.

im pretty new to this code editing stuff, so i dont get where the problem is.

i think this are the relevant parts of the code:

Mainloop:
Code:
 Func MainLoop()
	If GetMapID() == $MAP_ID_BH Then
		Out("Starting run #" & GUICtrlRead($RunLabel) + GUICtrlRead($FailLabel) + 1)
		SwitchMode($DIFFICULTY_NORMAL)
		Zone_Fast_Way()
	Else
		$BotSetUpResign = True
		Return False
	 EndIf
2277.49
    $MapID = GetMapID()
    If ($MapID == $MAP_ID_CD) Then
	   Out("Cliffs check, start run")
       RndSleep(500)

	Out("Prepping")
	UseSkillEx($vop)
    UseSkillEx($grenths)
    UseSkillEx($vos)


    Out("Waypoint 1")
	MoveRun(2406, -7406)
	Kill()

	Out("Waypoint 2")
	MoveRun(3038, -5846)
	Kill()

	Out("Waypoint 3")
	MoveRun(4110, -4442)
	Kill()

	Out("Waypoint 4")
	MoveRun(4764, -3082)
	Kill()

	Out("Waypoint 5")
	MoveRun(6793, 4133)
	Kill()

	Out("Waypoint 6")
	MoveRun(10294, 2024)
    Kill()

    Out("Waypoint 7")
	MoveRun(10888, -7)
    Kill()

    Out("Waypoint 8")
	MoveRun(11614, -925)
    Kill()

    Out("Waypoint 9")
	MoveRun(12582, -795)
    Kill()

    EndIf
	$RunLabel += 1
	StopMainLoop ()
 EndFunc   ;==>MainLoop
Func Kill:

Code:
 Func Kill()
 Local $lTimer, $lEnemiesCount, $lMe, $lTargetID, $lTargetStruct, $target
 $lTimer = TimerInit()
 $lEnemiesCount = GetNumberOfFoesInRangeOfAgent()
 CheckVoSCombat()
 RndSleep(500)
 If $lEnemiesCount >=1 Then
	$target = GetNearestEnemyToAgent(-2)
    ChangeTarget($target)
    RndSleep(150)
	Attack(-1)
    Sleep(200)
	If IsRecharged($sweep) Then
	   CheckVoSCombat()
	   TargetNearestEnemy()
	   UseSkill($sweep, -1)
	   RndSleep(200)
    EndIf
	Do
	   Out("Fighting")
	   If GetMapLoading() == 2 Then Disconnected()
	   If GetIsDead(-2) Then
		  StopMainLoop ()
		  Return
	   EndIf
	   CheckVoSCombat()
	   If GetIsDead($lTargetID) Then
		  $lTargetID = DllStructGetData(GetNearestEnemyToAgent(-2), 'ID')
		  If  [MENTION=368499]Extended[/MENTION] > $RANGE_NEARBY Then ExitLoop
		  Attack(-1)
	   EndIf
	   $target = GetNearestEnemyToAgent(-2)
	   ChangeTarget($target)
	   RndSleep(150)
	   Attack(-1)
	   Sleep(200)

	   If IsRecharged($sweep) Then
		  CheckVoSCombat()
		  TargetNearestEnemy()
		  UseSkill($sweep, -1)
		  RndSleep(200)
	   EndIf
	   If GetIsDead(-2) Then
		  StopMainLoop ()
		  Return
	   EndIf
	   CheckVoSCombat()
	   TargetNearestEnemy()
	   Attack(-1)
	   If GetSkillbarSkillAdrenaline($crippling) >= 150 Then
		  CheckVoSCombat()
		  TargetNearestEnemy()
		  UseSkill($crippling, -1)
		  RndSleep(800)
	   EndIf
	   If GetIsDead(-2) Then
		  StopMainLoop ()
		  Return
	   EndIf
	   CheckVoSCombat()
	   TargetNearestEnemy()
	   Attack(-1)
	   If GetSkillbarSkillAdrenaline($reap) >= 120 Then
		  CheckVoSCombat()
		  TargetNearestEnemy()
		  UseSkill($reap, -1)
		  RndSleep(800)
	   EndIf
	   If GetIsDead(-2) Then
		  StopMainLoop ()
		  Return
	   EndIf
	   Sleep(100)
	   CheckVoSCombat()
	   TargetNearestEnemy()
	   Attack(-1)
	   If TimerDiff($lTimer) > 7000 Then PickUpLoot()
	   If TimerDiff($lTimer) > 150000 Then
		  PickUpLoot()
		  Return
	   EndIf
	   If GetIsDead(-2) Then
		  StopMainLoop ()
		  Return
	   EndIf
	   $lEnemiesCount = GetNumberOfFoesInRangeOfAgent()
    Until $lEnemiesCount <= 0 Or TimerDiff($lTimer) > 150000
	   CancelAction()
	   Sleep(GetPing() + 250)
	  Out("Pick up loot")
	   PickUpLoot()
	  ;Out("Moving")
 EndIf
 EndFunc
Func MoveRun:

Code:
 Func MoveRun($DestX, $DestY)
   If GetMapLoading() == 2 Then Disconnected()
   If GetIsDead(-2) Then
	   StopMainLoop()
	   Return
   EndIf
   If GetMapID() = $MAP_ID_BH Then Return
   StuckTimer()
   ;Local $Me
   Local $Me = GetAgentByID(-2)
   Move($DestX, $DestY)
   Do
	  If GetMapLoading() == 2 Then Disconnected()
	  CheckVoS()
	  $Me = GetAgentByID(-2)
	  If GetIsDead(-2) Then
		  StopMainLoop()
		  Return
	  EndIf
	  If GetMapID() = $MAP_ID_BH Then Return
	  If DllStructGetData($Me, 'MoveX') == 0 Or DllStructGetData($Me, 'MoveY') == 0 Then Move($DestX, $DestY)
	  RndSleep(250)
   Until ComputeDistance(DllStructGetData($Me, 'X'), DllStructGetData($Me, 'Y'), $DestX, $DestY) < 250
EndFunc
I dont know maybe it has sth to do with this Func:
Func GetNumberOfFoesInRangeOfAgent

Code:
 Func GetNumberOfFoesInRangeOfAgent($aAgent = 0, $aRange = 2000)
   If GetMapLoading() == 2 Then Disconnected()
   Local $lAgent, $lDistance
   Local $lCount = 0, $lAgentArray = GetAgentArray(0xDB)
   If Not IsDllStruct($aAgent) Then $aAgent = GetAgentByID($aAgent)
   For $i = 1 To $lAgentArray[0]
	  $lAgent = $lAgentArray[$i]
	  If BitAND(DllStructGetData($lAgent, 'typemap'), 262144) Then
		If StringLeft(GetAgentName($lAgent), 7) <> "Servant" Then ContinueLoop
	  EndIf
	  If DllStructGetData($lAgent, 'Allegiance') <> 3 Then ContinueLoop
	  If DllStructGetData($lAgent, 'HP') <= 0 Then ContinueLoop
	  If BitAND(DllStructGetData($lAgent, 'Effects'), 0x0010) > 0 Then ContinueLoop
	  $lDistance = GetDistance($lAgent)
	  If $lDistance > $aRange Then ContinueLoop
	  $lCount += 1
   Next
   Return $lCount
EndFunc

I thought maybe it has something to do with too short "sleeps". but like the devourers just follow the bot the whole time...

i am thankful for any advise. thank you very much :)
10/22/2019 23:45 Kaspar L#183
I'm trying to get a bot to check that all party members are loaded before Resigning/Returning.

Is there a function for this? I've tried GetPartySize() but the function counts the not-yet loaded members as well. Not sure what else to try. Any help is appreciated.
10/23/2019 17:25 LamaChoco#184
Quote:
Originally Posted by phat34 View Post
longer sleeps and not just random ones... u need a getping style sleep. Also for different items there are different salvage recipes so look in a bot that does salvaging already and follow those methods.
The CanSalvage function already makes sure that the items returned can be salvaged to materials, which is why it only uses SalvageMaterials()

I don't see how using a sleep with getping would make a difference ? It is not functionnaly different than a random sleep. I will try longer sleeps though.

Anyway, this doesn't close the Salvage window, even when running it on only one item. I guess there should be a function in GWA that does it, but can't seem to find it
10/24/2019 22:02 Kaspar L#185
Using this function:

Code:
Func GetPartyMembers($aAgentArray = 0)
	Local $lTeam = GetAgentProperty(GetAgentByID(GetMyID()), 'Team')
	If $aAgentArray == 0 Then $aAgentArray = GetAgentArray(0xDB)
	Local $lReturnArray[$aAgentArray[0]+1]
	$lReturnArray[0] = 0
	For $i = 1 To $aAgentArray[0]
		If GetAgentProperty($aAgentArray[$i], 'Team') <> $lTeam Then ContinueLoop
		If GetAgentProperty($aAgentArray[$i], 'LoginNumber') = 0 Then ContinueLoop
		If GetAgentProperty($aAgentArray[$i], 'Allegiance') <> 1 Then ContinueLoop
		If Not BitAND(GetAgentProperty($aAgentArray[$i], 'TypeMap'), 131072) Then ContinueLoop
		$lReturnArray[0] += 1
		$lReturnArray[$lReturnArray[0]] = $aAgentArray[$i]
	Next
	ReDim $lReturnArray[$lReturnArray[0] + 1]
	Return $lReturnArray
EndFunc ;GetPartyMembers
I can scan the map and check the number of party members in it, which works fine in an explorable area.
But in an outpost it counts all players.
Is there a way to get beyond that and also check if the player in the outpost is also in my party?

Note: Using GWA2
Thanks for any help
10/27/2019 15:12 ForgottenRelic#186
Okay so I have tried a million times to try to fix this probably small error that I'm getting trying to fix this script. It cast the first 3 spells no issues but the 4th spell ( Shield of Absorption) its saying unknown function.. Is it not finding it somehow? Is the timing of the casting off? I am completely lost at this.
10/28/2019 03:40 Kaspar L#187
Quote:
Originally Posted by ForgottenRelic View Post
Okay so I have tried a million times to try to fix this probably small error that I'm getting trying to fix this script. It cast the first 3 spells no issues but the 4th spell ( Shield of Absorption) its saying unknown function.. Is it not finding it somehow? Is the timing of the casting off? I am completely lost at this.
It's because it is trying to call a function which is missing; "IsRecharged()".
The first 3 spells cast fine because they do not call that function when using them.

Code:
;~ Description: Returns if a skill is recharged.
Func IsRecharged($lSkill)
    Return GetSkillBarSkillRecharge($lSkill) == 0
EndFunc   ;==>IsRecharged
Plug that somewhere in your file (into "GWA2.au3" preferably).
10/28/2019 10:33 maintanosgr#188
How do you debug which packet is causing a game crash?
10/28/2019 10:51 oneshout#189
Quote:
Originally Posted by ForgottenRelic View Post
Okay so I have tried a million times to try to fix this probably small error that I'm getting trying to fix this script. It cast the first 3 spells no issues but the 4th spell ( Shield of Absorption) its saying unknown function.. Is it not finding it somehow? Is the timing of the casting off? I am completely lost at this.
You are using an old GWA2... all latest bots with GWA2 got this function in.
Be sure to have latest updated files (GWA2 and Headers) ;)

Code:
Func IsRecharged($lSkill)
	Return GetSkillbarSkillRecharge($lSkill) == 0
EndFunc   ;==>IsRecharged
10/29/2019 01:06 Nachico#190
Quote:
Originally Posted by maintanosgr View Post
How do you debug which packet is causing a game crash?
I don't think there is a debug for that. Make sure you have updated headers and GWA2.
10/29/2019 21:49 maintanosgr#191
I'm looking at some crashes on already made scripts from here like vaettirs etc so I wanted to see if there was a way to verify which packet is causing the crash. I think I'll add a file.log on each enqueue and sendpacket call to see what it will yield.
10/30/2019 14:29 LamaChoco#192
You can probably use the [Only registered and activated users can see links. Click Here To Register...] with the write to file function to see which packet was sent right before the crash
10/31/2019 16:36 oneshout#193
Some dev can confirm this function is updated please ?

Code:
;~ Description: Drop environment object.
Func DropBundle()
	Return PerformAction(0xCD, 0x18)
EndFunc   ;==>DropBundle
10/31/2019 21:17 richpianagroyper#194
Quote:
Originally Posted by oneshout View Post
Some dev can confirm this function is updated please ?

Code:
;~ Description: Drop environment object.
Func DropBundle()
	Return PerformAction(0xCD, 0x18)
EndFunc   ;==>DropBundle
maybe try
Code:
;~ Description: Drop environment object.
Func DropBundle()
	Return PerformAction(0xCD, 0x1e)
EndFunc   ;==>DropBundle
10/31/2019 21:31 sw4gdaddy#195
hey everyone i have some problems i hope i can get help with
1: im using the getagentbyname function which works fine if i use it with a client on which i didnt run a bot but if i ran a bot on the client it doesnt work, anyone knows a fix?
2: when i hit many foes with whirling defense (57) the bot starts to lag and doesnt seem to work properly even after theyre dead anyone know workaround?
3: is there code that allows the use of mods i want to use the "measure for measure" inscription but im unaware of a function that uses an item and also targets another(use measure for measure on great conch for example)
Oh and also i wanna ask if there is a way to adjust the height of a moveto command like when theres a bridge over an area and you use a moveto because you want to walk on the bridge but the code is understood as a moveto to the coordiantes under the bridge which are the same??