For those who are eager to put Autoit into action for use with CABAL, you would be glad with this post.
Lots of people PMed me on how did I manage to rotate my character so that it faces the right direction when botting.
I do that using trigonometry! (oh no)
But don't run away - yet
Complicated as it seems, it is just this function in AutoIt that does the magic.
Code:
_Degree(_ATan2($targetY - $currentY, $targetX - $currentX)
But hey, how would I know my current location?
See my siggy
Ok, but how would I know the target location?
Huh? Just go there and record the coordinates!
Oh sorry, one last question. How would I know how long to press the 'a' for left or 'd' for right to rotate my character?
Good question.
Based on my experiments, one full character rotation is approx 7560 ms. Ok, I will not make you dizzy with computation.
Here is the code:
Code:
Func _rotateLeft($ntimes) AutoItSetOption("SendKeyDownDelay", $ntimes * 21) Send("a") EndFunc ;==>_rotateLeft
As an example, if you got 45 as a result of the _Degree function above, then call _rotateLeft(45)
The code for rotation to the right is just as simple
Code:
Func _rotateRight($ntimes) AutoItSetOption("SendKeyDownDelay", $ntimes * 21) Send("d") EndFunc ;==>_rotateRight
Leechers will be confused. Learners will benefit from this post. Happy holidays!
UPDATE---Example:
If your current coordinate is (10,22) and you want to bot at location (100,120)
![](https://www.elitepvpers.com/forum/images/elitepvpers/buttons/hiddenimage.png)
Degrees returns 47
we just need to call _rotateLeft(47) to rotate our character