Jump to content
Sign in to follow this  
kforsey

Creating Mouse Movements Ingame

Recommended Posts

kforsey

I am currently trying to create a program for a game called Nox which was made in the year 2000 so it is a bit out of date. If I attempt to use the function mousemove it will move my cursor to one corner of the screen and wont follow where i tell it to go. Say I told it to go to X 500 Y 500, it would jsut randomly go to a corner of the screen. Anyone know what could be causing this and how I could fix it.

Thanks and any help would be appreciated.

Share this post


Link to post
Share on other sites
Insolence

Can you post the code?

It sends the EXACT messages your mouse would send if it were in game, so it's probably your code :lmao:


"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.

Share this post


Link to post
Share on other sites
kforsey

MouseClick("left", 500, 500) is my code. Stll got any ideas. Oh ya, i dont know if it makes any difference but the game is running in 1024x768 and is in 16 bit.

Edited by kforsey

Share this post


Link to post
Share on other sites
Wb-FreeKill

Im listening

Ive made a script witch you can control a mouse on another computer on the LAN. It works all fine i windows, but Battlefield (the game) the mouse sense was WAY to high

Both games had the same sense and same reloution in the game...

Share this post


Link to post
Share on other sites
kforsey

So do you have any idea how to solve this problem? I would really appreciate ANY help or advice anyone could give me.

Share this post


Link to post
Share on other sites
Wb-FreeKill

hmm, can't really see the problem. The only problem could be the resolution of the game...

Share this post


Link to post
Share on other sites
upnorth

i think some fullscreen games use a fake mouse...

#include <GUIConstants.au3>
HotKeySet("{ESC}","quit")
Opt("GUIOnEventMode", 1)


Global $size[3] , $mid[3] , $fake_mouse[3]
$size[1] = @DesktopWidth
$size[2] = @DesktopHeight
$mid[1] = Int($size[1] / 2)
$mid[2] = Int($size[2] / 2)

$win = GUICreate( "", $size[1], $size[2], 0, 0, $WS_POPUPWINDOW ,$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
$fake_mouse[0] = GUICtrlCreateButton("Fake mouse",0,0,75,25)

GuiCtrlSetOnEvent($fake_mouse[0],"quit")
GUISetState(@SW_SHOW)
MouseMove($mid[1],$mid[2],0)

While 1
    Sleep(10)
    $pos = MouseGetPos()
    $fake_mouse[1] = $fake_mouse[1] - ($mid[1] - $pos[0])
    $fake_mouse[2] = $fake_mouse[2] - ($mid[2] - $pos[1])
    MouseMove($mid[1],$mid[2],0)
    If $fake_mouse[1] > $size[1] Then
        $fake_mouse[1] = $size[1]
    ElseIf $fake_mouse[1] < 0 Then
        $fake_mouse[1] = 0
    EndIf
    
    If $fake_mouse[2] > $size[2] Then
        $fake_mouse[2] = $size[2]
    ElseIf $fake_mouse[2] < 0 Then
        $fake_mouse[2] = 0
    EndIf
    GUICtrlSetPos($fake_mouse[0],$fake_mouse[1],$fake_mouse[2])
WEnd


func quit()
    Exit
EndFunc

Edit:new script

fake_mouse.au3

Edited by UP NORTH

Share this post


Link to post
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
Sign in to follow this  

×