edit: removed a lot of fluff code: warning: this is stripped down, will cause unexpected results!
Code:
Private Sub RightClickTurn(ByVal gamePoint As worldPoint, ByVal asGhost As Boolean)
If gamePoint.TurnDistance() <= 0.2 Then Exit Sub 'already facing point, exit sub
'Move cursor to right-click-turnable point on wow.gui
modPublic.SetCursorPos(GOOEY.RCTP.X, GOOEY.RCTP.Y)
Threading.Thread.Sleep(350) 'sleep because setcursorpos() takes a second, if I didn't sleep it would mouse_down at the wrong location
mouse_event(MouseFlags.RIGHTDOWN, 0, 0, 0, 0)
While gamePoint.TurnDistance > 0.05
If gamePoint.TurnDirection = "left" Then
If gamePoint.TurnDistance > 0.2 Then
mouse_event(MouseFlags.MOVE, -30, 0, 0, 0)
Else
mouse_event(MouseFlags.MOVE, -5, 0, 0, 0)
End If
Else
If gamePoint.TurnDistance > 0.2 Then
mouse_event(MouseFlags.MOVE, 30, 0, 0, 0)
Else
mouse_event(MouseFlags.MOVE, 5, 0, 0, 0)
End If
End If
Threading.Thread.Sleep(150) ' needs some time of sleep -> or will over turn
End While
' right_click_up to return mouse to a normal state..we're done turning
mouse_event(MouseFlags.RIGHTUP, 0, 0, 0, 0)
End Sub
It has a few bugs/problems, but..
1) Wow must be active window because I just use mouse_event..it doesn't send to 'wow.exe' it sends to 'active app'
2) it turns by 5|30 px which works for me..could be refined ?
3) I could have checked Wow's Form.Location + .Width to make a 'best guess' for where to move the cursor to 'turn-click' but I use a ' GUI callibrate ' form, so..depends on your needs really.
** it would be 100% better if wow didn't have to be the active app, but it works for me, a private bot for when I'm asleep: It REALLY can be annoying to have the bot basically own ur pc and not be able to use other programs -> probably not what you want...