Hi,
I have been looking into writing a dungeon farming bot which takes in an .xml script and processes a series of actions using mouse clicks, keys, delays and loops - trying to best emulate actual keyboard strokes and mouseclicks.
One thing I have had difficulty is accurately turning. As far as movement is concerned I find I can go forwards, backwards, and strafe left/right and the consistency each run is pretty exact. As soon as I try to make a turn it gets inconsistent.
I am writing the program in C#, and have been using InputSimulator for the mouse and keystrokes. I also tried Win32 stuff but also seems to have a degree of inconsistency.
For example, turning left or right for 2 seconds (2000ms) should complete a 360 turn. So turning right for 500ms should make a 90 degree turn. And a lot of the time it does, but then sometimes overstretches or doesn't turn enough, which then obviously throws the rest of the bot out.
A snippet of example code - press the right key down, wait 500ms, press right key up again :-
using WindowsInput;
using WindowsInput.Native;
....
InputSimulator isim = new InputSimulator();
isim.Keyboard.KeyDown("RIGHT");
System.Threading.Thread.Sleep(500);
isim.Keyboard.KeyUp("RIGHT");
I've also tried using Win32 to just tap the LEFT key and then doing this a number of times, once again has inaccurate results.
It's not a problem if it takes several seconds to make a 90 degree turn, I just need it to do it consistently at 90 degrees every run.
Has anyone else had similar experiences and could help?