Sign in to follow this  
Followers 0
Merlin

Howto MouseGetPos in a 3dwindow/game?

25 posts in this topic

Howto MouseGetPos in a 3dwindow/game?

if i use it it always returns same position ... ;-(

i tried

Opt("MouseCoordMode", 0)

and

Opt("MouseCoordMode", 1)

but no success...

any hints tipsntricks?!

btw: anyone knows whats is the best way to start c++?? (i have Microsoft Visual C++ 6 0 Standard Edition)

good forum ? (maybe a german one?) where to get tutorials?

is there something like www.selfhtml.org for c++ ?

Share this post


Link to post
Share on other sites



I don't know, but what game are you working on?

Share this post


Link to post
Share on other sites

Oo, cool! Do you play any games online?

Share this post


Link to post
Share on other sites

Can you put a snippet of code where you try to grab the coords?

Def

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

:)

Opt("TrayIconDebug", 1)
Opt("MouseCoordMode", 0)

HotKeySet("{PGUP}","moveit")
While 1
 Sleep(5)
Wend

Func moveit()
 $pos = MouseGetPos()
 MsgBox(0, "X/Y:", $pos[0] "," $pos[1])
 MouseDown("left")
 MouseMove($pos[0], $pos[1]+4, 4)
 Sleep(110)
 MouseUp("left")
 $pos = MouseGetPos()
 MsgBox(0, "X/Y:", $pos[0] "," $pos[1])
 MouseMove($pos[0], $pos[1]-4, 4)
 Sleep(50)
 MsgBox(0, "X/Y:", $pos[0] "," $pos[1])
EndFunc

but that just returns always same x y coordinates...makes no diff. if i use

Opt("MouseCoordMode", 0) or Opt("MouseCoordMode", 1)

Edited by Merlin

Share this post


Link to post
Share on other sites

Is it a full screen 3d window?


Who else would I be?

Share this post


Link to post
Share on other sites

Does the cursor in the game look different than the regular windows cursor? If so, the ACTUAL cursor position is really staying in the same spot, and the game is taking over the cursor function. If that is so, then you will never be able to get the position of the game's cursor.


Who else would I be?

Share this post


Link to post
Share on other sites

i tried it windowed and fullscreen same results...

<{POST_SNAPBACK}>

Here is some code I use and it works windowed or not in Lineage2...

Func back2L2()
   $CENTER_X = @DesktopWidth / 2 
   $CENTER_Y = @DesktopHeight / 2
   $pos = MouseGetPos()
   MouseClick("left", $CENTER_X, $CENTER_Y , 0)
   sleep(200)
   MouseMove($pos[0], $pos[1], 0)
endFunc

Share this post


Link to post
Share on other sites

ok. here is what you do

the game window is not able to get coordinates, because it takes up the full screen, and is not in window mode.

make a shortcut to the game (right click.. add shortcut)

then , right clck the shortcut and select properties

at the END of the target.. just add -w

that will make the game load into a window.. instead of taking up the whole screen. and then mousegetcoor will work

later

~Todd


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

ok. here is what you do

the game window is not able to get coordinates, because it takes up the full screen, and is not in window mode.

make a shortcut to the game (right click.. add shortcut)

then , right clck the shortcut and select properties

at the END of the target.. just add -w

that will make the game load into a window.. instead of taking up the whole screen. and then mousegetcoor will work

later

~Todd

<{POST_SNAPBACK}>

That is completely false. The only game I know of that does that is Diablo II. Other Blizzard games might also support that; some other games may also support it, but not all. Somebody else has already pointed this out to you. Command line options are not global across applications.

Share this post


Link to post
Share on other sites

i tried it windowed and fullscreen same results...

<{POST_SNAPBACK}>

i already tried windowed mode ...

Here is some code I use and it works windowed or not in Lineage2...

Func back2L2()
   $CENTER_X = @DesktopWidth / 2 
   $CENTER_Y = @DesktopHeight / 2
   $pos = MouseGetPos()
   MouseClick("left", $CENTER_X, $CENTER_Y , 0)
   sleep(200)
   MouseMove($pos[0], $pos[1], 0)
endFunc

<{POST_SNAPBACK}>

ill try that thx

btw.: what is lineage for a game`? maybe u know which engine?

Share this post


Link to post
Share on other sites

i thought it was supported globally.

because of the fact that the game is FULLSCREEN and that blizzard intended

it to be that way, i thought the -w was a way of getting around that.

since it is not in the game manual, i thought they did not want you to be able to do that.

so, why would they include the option of being able to do that?

i thought it applied to ANY full screen application.

it was just a suggestion, and i stand corrected.

but try it, never know. might work.

~Todd


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

i already tried windowed mode ...

ill try that thx

btw.: what is lineage for a game`? maybe u know which engine?

<{POST_SNAPBACK}>

Lineage II uses a modded Unreal engine.

Share this post


Link to post
Share on other sites

i thought it was supported globally.

because of the fact that the game is FULLSCREEN and that blizzard intended

it to be that way, i thought the -w was a way of getting around that.

since it is not in the game manual, i thought they did not want you to be able to do that.

so, why would they include the option of being able to do that?

i thought it applied to ANY full screen application.

it was just a suggestion, and i stand corrected.

but try it, never know. might work.

~Todd

<{POST_SNAPBACK}>

There are so many flaws in that logic that I'm at a loss on where to begin.

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  
Followers 0