Quote:
Originally Posted by Scythe X
Merry Christmas yall.
Here is a modified version of the Gigi vaettir script. I adapted it for D/N.
PvXwiki build: [Only registered and activated users can see links. Click Here To Register...]
Consumables are highly recommended but not required to function. I am considering reiterating the D/A build just due to the issue of constant body blocking. i am not sure how to code a movement that avoids being body blocked. Any suggestions welcome, thanks. Happy 2024:notsureif:
|
There's a few possible steps you can take...
You can do a
Code:
Global $ChatStuckTimer = TimerInit()
which has been previously used by other people, to include Gigi's version of Vaettir. The only thing is that it doesn't avoid it, it just attempts to unblock/unstuck.
Code:
If GetDistance() > 1100 Then ; tarGet is far, we probably got stuck.
If TimerDiff($ChatStuckTimer) > 3000 Then ; dont spam
SendChat("stuck", "/")
$ChatStuckTimer = TimerInit()
RndSleep(GetPing())
If GetDistance() > 1100 Then ; we werent stuck, but tarGet broke aggro. select a new one.
TarGetNearestEnemy()
EndIf
EndIf
EndIf
Then there's another option that you can probably utilize
CustomMoveTo function as a dependency and create a separate function to handle the scenario when your character is blocked. This is a bit more complicated and you would need to kinda test/trial something like this:
Code:
Func UnblockAndMove($aX, $aY, $aRandom = 50, $maxUnblockAttempts = 15)
Local $unblockAttempt = 0
Local $moveResult
; Attempt to move to the destination
$moveResult = CustomMoveTo($aX, $aY, $aRandom)
; Loop until unblocked or maximum attempts reached
While $moveResult = $CustomMoveToReturnStuck And $unblockAttempt < $maxUnblockAttempts
; Increase the attempt counter
$unblockAttempt += 1
; Example: Move in a small random direction
Local $newX = Random(-10, 10, 1)
Local $newY = Random(-10, 10, 1)
Move($newX, $newY, 0)
; Sleep to allow the unblocking action to take effect
Sleep(1000)
; Retry moving to the original destination
$moveResult = CustomMoveTo($aX, $aY, $aRandom)
WEnd
; Check if unblock attempts were unsuccessful
If $unblockAttempt >= $maxUnblockAttempts Then
; Call the TravelGH function and sleep
TravelGH()
Sleep(1000)
EndIf
Return $moveResult
EndFunc ;==>UnblockAndMove
Keep in mind if you using this one you also need to integrate it into your main func
Code:
; Call UnblockAndMove function
Local $result = UnblockAndMove($targetX, $targetY)
There's alot more to it that needs to be done it's just some of the ground work if you wanna take that route. Sometimes it's easier to not re-invent the wheel if there's already something that works.