Jump to content

Mousemoving Problems


Recommended Posts

Hi im new at this forum :)

So I started to make an aimbot just 4 fun for a Game called War§ow (based on modded Quake 2 Engine).

The Aimbot works (tested with red colored icons on the desktop).

But it doesnt work ingame ; fullscreen or windowed <- both tested.

Hope anyone can help me.

Global $Aimbot = 0
Global $Pause = 1

Opt("MouseCoordMode", 0)
Opt("PixelCoordMode", 0)
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)

HotKeySet("{NUMPADDOT}", "Aimbotoff" )
HotKeySet("{NUMPADADD}", "Aimboton" )

If $Pause = 1 Then
    While 1
        Sleep(1000)
    WEnd
EndIf


Func Aimbotoff()
    $Aimbot = 0
    $Pasue = 1
EndFunc

Func Aimboton()
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
            $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
            If IsArray($coord) = 1 Then
                MouseClick('left', $coord[0], $coord[1], 1, 0)
            EndIf
    EndIf
WEnd 
EndFunc
Link to comment
Share on other sites

Sorry forgot to discribe my problem -.-"

So on desktop or other windows the script works perfectly but ingame (fullscreen or windowed) the mouse stays the whole time at the same position.

It wont move the crosshair/courser :)

Sorry didnt found the edit button.

Link to comment
Share on other sites

Im not sure about this particular game, some games require some "speacial" ways to get the mouse to move. But at first glance I would say to try setting the Mouseclick function to something other than instant click. As itt is right now your not actually telling the mouse to "move" to the location.

Change this

MouseClick('left', $coord[0], $coord[1], 1, 0)oÝ÷ Ù:-+ºÚ"µÍ[ÝÙPÛXÚÊ ÌÎNÛY    ÌÎNË ÌÍØÛÛÜÌK ÌÍØÛÛÜÌWKKL

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

you shouldnt bump so quickly.

The next thing I would try is something like this to move the mouse.

Func Aimboton()
$user32 = DllOpen("user32.dll")
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
        $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
        If IsArray($coord) = 1 Then
            DllCall($user32,"none","mouse_event","long",32769,"long",($coord[0]*(65535/@DesktopWidth)),"long",($coord[1]*(65535/@DesktopHeight)),"long",0,"long",0)
            MouseClick('left')
        EndIf
    EndIf
WEnd
DllClose($user32)
EndFunc

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

maybe I should say that im using win vista home premium 32bit ^^

something about the cursor in the game :

it isnt the windows cursor it is an opengl cursor

so it is differently from the windows cursor :)

Edited by the1venom
Link to comment
Share on other sites

i found something that could help.

in the warsow_x86.exe there is an function :

CL_MouseMove( usercmd_t *cmd, int mx, int my )

SourceCode(Its written in C):

void CL_MouseMove( usercmd_t *cmd, int mx, int my )

{

// wsw : aiwa : cursor position now stored as float for better filtering

static float mouse_x = 0, mouse_y = 0;

float accelSensitivity = sensitivity->value *CL_GameModule_SetSensitivityScale( sensitivity->value );

if( cls.key_dest == key_menu )

{

CL_UIModule_MouseMove( mx, my );

return;

}

if( ( cls.key_dest == key_console ) && !in_grabinconsole->integer )

return;

switch( m_filter->integer )

{

case M_FILTER_INTERPOLATE:

{

// wsw : aiwa : new mouse smoothing with m_filterStrength

static float old_mouse_x = 0, old_mouse_y = 0;

old_mouse_x = mouse_x = ( mx + ( old_mouse_x * m_filterStrength->value ) ) / ( 1 + m_filterStrength->value );

old_mouse_y = mouse_y = ( my + ( old_mouse_y * m_filterStrength->value ) ) / ( 1 + m_filterStrength->value );

}

break;

case M_FILTER_EXTRAPOLATE:

{

// wsw : aiwa : mouse extrapolation

float extra_x, extra_y;

CL_MouseExtrapolate( mx, my, &extra_x, &extra_y );

mouse_x = mx + extra_x * m_filterStrength->value;

mouse_y = my + extra_y * m_filterStrength->value;

}

break;

default:

mouse_x = mx;

mouse_y = my;

break;

}

// wsw : aiwa : only perform accel calculation if user actually uses accel

if( m_accel->value != 0.0 && m_accel->value != -0.0 )

{

float rate = sqrt( mouse_x * mouse_x + mouse_y * mouse_y ) / (float) frame_msec;

accelSensitivity += rate * m_accel->value;

}

// add mouse X/Y movement to cmd

if( ( in_strafe.state & 1 ) || ( lookstrafe->integer && mlooking ) )

cmd->sidemove += ( accelSensitivity * m_side->value ) * mouse_x;

else

cl.viewangles[YAW] -= ( accelSensitivity * m_yaw->value ) * mouse_x;

if( ( mlooking || cl_freelook->integer ) && !( in_strafe.state & 1 ) )

cl.viewangles[PITCH] += ( accelSensitivity * m_pitch->value ) * mouse_y;

else

cmd->forwardmove -= ( accelSensitivity * m_forward->value ) * mouse_y;

}

Could this function help me and how can i run it from autoit?

Link to comment
Share on other sites

so ill do the mouse move with the SDL.dll an this event http://docs.mandragor.org/files/Common_lib...lwarpmouse.html .

but there is an error when i start the aimbot

Func Aimboton()
$sdl = DllOpen("F:\SDL\SDL.dll")
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
        $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
        If IsArray($coord) = 1 Then
            DllCall($sdl,"none","SDL_WarpMouse(Uint16 $coord[0], Uint16 $coord[1])"
            MouseClick('left')
        EndIf
    EndIf
WEnd
DllClose($user32)
EndFunc

Error while parsing function ... someone can help me?

Link to comment
Share on other sites

so ill do the mouse move with the SDL.dll an this event http://docs.mandragor.org/files/Common_lib...lwarpmouse.html .

but there is an error when i start the aimbot

Func Aimboton()
$sdl = DllOpen("F:\SDL\SDL.dll")
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
        $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
        If IsArray($coord) = 1 Then
            DllCall($sdl,"none","SDL_WarpMouse(Uint16 $coord[0], Uint16 $coord[1])"
            MouseClick('left')
        EndIf
    EndIf
WEnd
DllClose($user32)
EndFunc

Error while parsing function ... someone can help me?

Func Aimboton()
$sdl = DllOpen("F:\SDL\SDL.dll")
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
        $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
        If IsArray($coord) = 1 Then
            DllCall($sdl,"none","SDL_WarpMouse(Uint16 " & $coord[0] & ", Uint16 " & $coord[1] & ")")
            MouseClick('left')
        EndIf
    EndIf
WEnd
DllClose($user32)
EndFunc

My Projects: [topic="89413"]GoogleHack Search[/topic], [topic="67095"]Swiss File Knife GUI[/topic], [topic="69072"]Mouse Location Pointer[/topic], [topic="86040"]Standard Deviation Calculator[/topic]

Link to comment
Share on other sites

Syntax was messed up a bit. I think thats closer but I donno without seeing the include SDL.h

Func Aimboton()
$sdl = DllOpen("F:\SDL\SDL.dll")
$Pause = 0
$Aimbot = 1
While 1
    If $Aimbot = 1 Then
        $coord = PixelSearch( 0, 0, 1280, 1024, 0xFFFF00, 10, 3 )
        If IsArray($coord) = 1 Then
            DllCall($sdl,"none","SDL_WarpMouse",$coord[0],$coord[1])
            MouseClick('left')
        EndIf
    EndIf
WEnd
DllClose($sdl)
EndFunc

Edit: Ealric beat me by 2 min :)

Edited by ofLight

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Link to comment
Share on other sites

Firstly thank you for correcting my syntax. I havent tested it already.

/*
    SDL - Simple DirectMedia Layer
    Copyright (C) 1997-2006 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Sam Lantinga
    slouken@libsdl.org
*/

/* Main include header for the SDL library */

#ifndef _SDL_H
#define _SDL_H

#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_cpuinfo.h"
#include "SDL_endian.h"
#include "SDL_error.h"
--->#include "SDL_events.h"<---
#include "SDL_loadso.h"
#include "SDL_mutex.h"
#include "SDL_rwops.h"
#include "SDL_thread.h"
#include "SDL_timer.h"
#include "SDL_video.h"
#include "SDL_version.h"

#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif

/* As of version 0.5, SDL is loaded dynamically into the application */

/* These are the flags which may be passed to SDL_Init() -- you should
   specify the subsystems which you will be using in your application.
*/
#define SDL_INIT_TIMER      0x00000001
#define SDL_INIT_AUDIO      0x00000010
#define SDL_INIT_VIDEO      0x00000020
#define SDL_INIT_CDROM      0x00000100
#define SDL_INIT_JOYSTICK   0x00000200
#define SDL_INIT_NOPARACHUTE    0x00100000  /* Don't catch fatal signals */
#define SDL_INIT_EVENTTHREAD    0x01000000  /* Not supported on all OS's */
#define SDL_INIT_EVERYTHING 0x0000FFFF

/* This function loads the SDL dynamically linked library and initializes 
 * the subsystems specified by 'flags' (and those satisfying dependencies)
 * Unless the SDL_INIT_NOPARACHUTE flag is set, it will install cleanup
 * signal handlers for some commonly ignored fatal signals (like SIGSEGV)
 */
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);

/* This function initializes specific SDL subsystems */
extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags);

/* This function cleans up specific SDL subsystems */
extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags);

/* This function returns mask of the specified subsystems which have
   been initialized.
   If 'flags' is 0, it returns a mask of all initialized subsystems.
*/
extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags);

/* This function cleans up all initialized subsystems and unloads the
 * dynamically linked library.  You should call it upon all exit conditions.
 */
extern DECLSPEC void SDLCALL SDL_Quit(void);

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"

#endif /* _SDL_H */

So thats the source code from the SDL.h but i think you'll need the sourc of the other files too, because in this file there are just includes :)

You see in the SDL.h is the SDL_Events.h file included and in that file there is the SDL_Mouse file included.

SDL_Mouse.h file:

/*
    SDL - Simple DirectMedia Layer
    Copyright (C) 1997-2006 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Sam Lantinga
    slouken@libsdl.org
*/

/* Include file for SDL mouse event handling */

#ifndef _SDL_mouse_h
#define _SDL_mouse_h

#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"

#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif

typedef struct WMcursor WMcursor;   /* Implementation dependent */
typedef struct SDL_Cursor {
    SDL_Rect area;          /* The area of the mouse cursor */
    Sint16 hot_x, hot_y;        /* The "tip" of the cursor */
    Uint8 *data;            /* B/W cursor data */
    Uint8 *mask;            /* B/W cursor mask */
    Uint8 *save[2];         /* Place to save cursor area */
    WMcursor *wm_cursor;        /* Window-manager cursor */
} SDL_Cursor;

/* Function prototypes */
/*
 * Retrieve the current state of the mouse.
 * The current button state is returned as a button bitmask, which can
 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
 * current mouse cursor position.  You can pass NULL for either x or y.
 */
extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y);

/*
 * Retrieve the current state of the mouse.
 * The current button state is returned as a button bitmask, which can
 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the
 * mouse deltas since the last call to SDL_GetRelativeMouseState().
 */
extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);

/*
 * Set the position of the mouse cursor (generates a mouse motion event)
 */
--->extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y);<---

/*
 * Create a cursor using the specified data and mask (in MSB format).
 * The cursor width must be a multiple of 8 bits.
 *
 * The cursor is created in black and white according to the following:
 * data  mask   resulting pixel on screen
 *  0    1     White
 *  1    1     Black
 *  0    0     Transparent
 *  1    0     Inverted color if possible, black if not.
 *
 * Cursors created with this function must be freed with SDL_FreeCursor().
 */
extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
        (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);

/*
 * Set the currently active cursor to the specified one.
 * If the cursor is currently visible, the change will be immediately 
 * represented on the display.
 */
extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);

/*
 * Returns the currently active cursor.
 */
extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void);

/*
 * Deallocates a cursor created with SDL_CreateCursor().
 */
extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor);

/*
 * Toggle whether or not the cursor is shown on the screen.
 * The cursor start off displayed, but can be turned off.
 * SDL_ShowCursor() returns 1 if the cursor was being displayed
 * before the call, or 0 if it was not.  You can query the current
 * state by passing a 'toggle' value of -1.
 */
extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);

/* Used as a mask when testing buttons in buttonstate
   Button 1:    Left mouse button
   Button 2:    Middle mouse button
   Button 3:    Right mouse button
   Button 4:    Mouse wheel up   (may also be a real button)
   Button 5:    Mouse wheel down (may also be a real button)
 */
#define SDL_BUTTON(X)       (1 << ((X)-1))
#define SDL_BUTTON_LEFT     1
#define SDL_BUTTON_MIDDLE   2
#define SDL_BUTTON_RIGHT    3
#define SDL_BUTTON_WHEELUP  4
#define SDL_BUTTON_WHEELDOWN    5
#define SDL_BUTTON_X1       6
#define SDL_BUTTON_X2       7
#define SDL_BUTTON_LMASK    SDL_BUTTON(SDL_BUTTON_LEFT)
#define SDL_BUTTON_MMASK    SDL_BUTTON(SDL_BUTTON_MIDDLE)
#define SDL_BUTTON_RMASK    SDL_BUTTON(SDL_BUTTON_RIGHT)
#define SDL_BUTTON_X1MASK   SDL_BUTTON(SDL_BUTTON_X1)
#define SDL_BUTTON_X2MASK   SDL_BUTTON(SDL_BUTTON_X2)


/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"

#endif /* _SDL_mouse_h */

---> Thats SDL Simple Direct Media Layer

Hope that will help. Its written in C++.

Edited by the1venom
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...