I'm writing a WoW bot with autoit I intend to publicly release and I'm using the following for rotation:
Func _SetRotation ($Handle,$pBase, $RotNeeded)
Sleep(3000); for testing, make sure window we're focused on WoW
If (_GetRotation($Handle,$pBase)- $RotNeeded) < 0 Then
Do
Send("{D down}")
Until ((_GetRotation($Handle,$pBase)- $RotNeeded) > 0.0)
Send("{D up}")
EndIf
If (_GetRotation($Handle,$pBase)- $RotNeeded) > 0 Then
Do
Send("{A down}")
Until ((_GetRotation($Handle,$pBase)- $RotNeeded) < 0.0)
Send("{A up}")
EndIf
endFunc
The problem is that when I call it, nothing happens, however when I press the {enter} key (ingame chat key) I can clearly see that the {a} key is being pressed (via the string of "aaaaaaaaaaaaaaaaaaaa..." appearing on the screen)
Solution found, using controlsend instead of send
http://www.autoitscript.com/autoit3/...ontrolSend.htm
Also realized (via reply from this thread), should be
Send("{A down}")
Do
Until ((_GetRotation($Handle,$pBase)- $RotNeeded) < 0.0)
Send("{A up}")
I'm hoping to get a better way to send keys but this will be nice until finals are over.
Thanks to everyone who responded.