Like this let me draw a bit to make a little easy to understand the way:
So your code is telling that, you get the screen dimensions and set it down but it don't go as the objective, it jumps from A to B as in draw, it show be like this:
So you go setting the position from point A to B like A A¹ A² A³ a³ a² a¹ ab b¹ b² b³ B³ B² B¹ B
More clear:
* What you are doing:
A -> B
* What should be done:
A A¹ A² A³ a³ a² a¹ ab b¹ b² b³ B³ B² B¹ B
But how could that be done?
-> Looping
Just a pseudo-code
Code:
Code:
int posX = 0; //You have to set it to middle of screen where your Crosshair is... This one will not move since it will only move in X (sides)
int posY = 0; //You have to set it to middle of screen where your Crosshair is up/down (you don't want it to go up, so you just gonna set it down
if (GetAsyncKeyState(1) & 0x8000) {
for(int i = 0; i < 255 /* A Number that you want to stop it going down ( You have to test by Yourself ) */; i++) { //Why not a WHILE? Think... You don't need to go forever down, so with a FOR LOOP, you can limit the amount
if (posY <= MIDDLE_SCREEN_Y) {
posY -= 10; //Any ammount you want to go down ( You have to test by Yourself )
mouseEvent_Down(posX /* We don't need to move X */, posY);
Sleep(100 /*Amount of time/ms you want ms*/);
}
}
}
...
So that is what you should do...
At least HIT THANKS... And next time try to read what you are doing and explain better what you want, any question post here or add me on skype, i will be back coding now...
-------------------------
Edit:
Just a new idea in code that may work better...
Code:
int posX = 0; //You have to set it to middle of screen where your Crosshair is... This one will not move since it will only move in X (sides)
int posY = 0; //You have to set it to middle of screen where your Crosshair is up/down (you don't want it to go up, so you just gonna set it down
if (GetAsyncKeyState(1) & 0x8000) {
for(int i = 0; i < 255 /* A Number that you want to stop it going down ( You have to test by Yourself ) */; i++) { //Why not a WHILE? Think... You don't need to go forever down, so with a FOR LOOP, you can limit the amount
if (posY <= MIDDLE_SCREEN_Y && /* AND */ posY > 0) {
posY -= 10; //Any ammount you want to go down ( You have to test by Yourself )
}
else { //WILL happen if 0 reachs and is in loop
posY = MIDDLE_SCREEN_Y; //WILL hard set back to middle screen
}
mouseEvent_Down(posX /* We don't need to move X */, posY);
Sleep(100 /*Amount of time/ms you want ms*/);
}
}