Help with Moving Mouse

Posts 1–9 of 9 · Page 1 of 1
Help with Moving Mouse
This code is supposed to move your mouse in a Box

First up then left then down then right
But it doesn't work.

Code:
void MyHackz(void)
{
	while(1)
	{
		if(GetAsyncKeyState(VK_NUMPAD1)&1)
		{
			BotWait = !BotWait;
			GetCursorPos(&mouse_pos);
			X=mouse_pos.x;
			Y=mouse_pos.y;
		}
		if(BotWait)
		{
			if(GetAsyncKeyState(VK_SPACE)&1)
			{
				LeftClickDown();
				X = X + 100;
				SetCursorPos(X, Y);
				Y = Y - 100;
				SetCursorPos(X, Y);
				X = X - 100;
				SetCursorPos(X, Y);
				Y = Y + 100;
				SetCursorPos(X, Y);
				LeftClickUp();
			}
		}else{
		}
		Sleep (100);
	}
}
What's wrong with it. And also, you will need the functions for left clicking etc if you wanna leech this.

All it does.. Is keep moving the mouse to the exact same spot where it started as
because it's too fast in executing you won't see it.
Code:
			if(GetAsyncKeyState(VK_SPACE)&1)
			{
				LeftClickDown();
				X = X + 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				Y = Y - 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				X = X - 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				Y = Y + 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				LeftClickUp();
			}
Also this section is meant for people to learn from, even leechers. So here's a LeftClickDown & Up:
Code:
void LeftClickDown()
{
    POINT cursorPos;
    GetCursorPos(&cursorPos);
    mouse_event(MOUSEEVENTF_LEFTDOWN, cursorPos.X, cursorPos.Y, 0, 0);
}

void LeftClickUp()
{
    POINT cursorPos;
    GetCursorPos(&cursorPos);
    mouse_event(MOUSEEVENTF_LEFTUP, cursorPos.X, cursorPos.Y, 0, 0);
}
Quote Originally Posted by Hell_Demon View Post
because it's too fast in executing you won't see it.
Code:
			if(GetAsyncKeyState(VK_SPACE)&1)
			{
				LeftClickDown();
				X = X + 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				Y = Y - 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				X = X - 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				Y = Y + 100;
				SetCursorPos(X, Y);
                                Sleep(500);
				LeftClickUp();
			}
Also this section is meant for people to learn from, even leechers. So here's a LeftClickDown & Up:
Code:
void LeftClickDown()
{
    POINT cursorPos;
    GetCursorPos(&cursorPos);
    mouse_event(MOUSEEVENTF_LEFTDOWN, cursorPos.X, cursorPos.Y, 0, 0);
}

void LeftClickUp()
{
    POINT cursorPos;
    GetCursorPos(&cursorPos);
    mouse_event(MOUSEEVENTF_LEFTUP, cursorPos.X, cursorPos.Y, 0, 0);
}
Oh thanks
I'll fix it up, and my click codes are a tat different

Code:
void LeftClickDown ( )
{  
  INPUT    Input={0};
  // left down 
  Input.type      = INPUT_MOUSE;
  Input.mi.dwFlags  = MOUSEEVENTF_LEFTDOWN;
  ::SendInput(1,&Input,sizeof(INPUT));
}

void LeftClickUp( )
{
	INPUT    Input={0};
	  // left up
  ::ZeroMemory(&Input,sizeof(INPUT));
  Input.type      = INPUT_MOUSE;
  Input.mi.dwFlags  = MOUSEEVENTF_LEFTUP;
  ::SendInput(1,&Input,sizeof(INPUT));
}
*Going to Leech and Release as my Own*
Never forget the "Sleep(500);" if play reaction game, your reaction is mostly 200-400 Ms, 1000Ms = 1 Second
Quote Originally Posted by UhWatchMe View Post
Never forget the "Sleep(500);" if play reaction game, your reaction is mostly 200-400 Ms, 1000Ms = 1 Second
Epic Bump is Epic.

HD Nice catch
Quote Originally Posted by fukojr2 View Post


Epic Bump is Epic.

HD Nice catch
Normally I would say something, but this forum has been basically dead since .net went down.
Quote Originally Posted by why06 View Post


Normally I would say something, but this forum has been basically dead since .net went down.
Its up again lol
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None

Talk with us