Jump to content

Sorry, Still having trouble with mouse coords


TokeySmurf
 Share

Recommended Posts

here is what I got. I know its all probably backwords been working on it awhile now just trying diffrent things, Someone suggested tooltip said thats what I went with.. having problems with syntaxx.

Func mcoord()
            $pos = MouseGetPos()
            $mpos = ToolTip("")
            GUICtrlSetData($mpos, $pos "")
sleep(200)

EndFunc

Thanks for help

-Tokey

Link to comment
Share on other sites

  • Moderators

here is what I got. I know its all probably backwords been working on it awhile now just trying diffrent things, Someone suggested tooltip said thats what I went with.. having problems with syntaxx.

Func mcoord()
            $pos = MouseGetPos()
            $mpos = ToolTip("")
            GUICtrlSetData($mpos, $pos "")
sleep(200)

EndFunc         

oÝ÷ Ù8ZK¢¸^è쿪ê-{T­É-¢Ø^¶br̨¹ÊÞjרØ^²æãyËn®
See anything different other than variable names and the fact that I'm using a msgbox?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

  • Moderators

I'm not much of one for copying and pasting so if perhaps you could hint me towards a help doc or just a little more explaniation if you could sorry, I'm really new to this. Just been doing alot of reading and going from there heh

I think the explination in the help file explains it all:

Returns a two-element array that containing the mouse coordinates: $array[0] = X coord (horizontal), $array[1] = Y coord (vertical)

Look under return values to see things like this.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

here is what I got. I know its all probably backwords been working on it awhile now just trying diffrent things, Someone suggested tooltip said thats what I went with.. having problems with syntaxx.

Func mcoord()
            $pos = MouseGetPos()
            $mpos = ToolTip("")
            GUICtrlSetData($mpos, $pos "")
sleep(200)

EndFunc         

oÝ÷ Ù8ZK¢¸^è쿪ê-y8^~éܶ*'º¹oÝ÷ Ø è¶«¶§êå

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thanks alot everyone, That did help me understand more, sometimes I can look at the help file and understand it, other times its like ahhh hehe.. I'm going to play with arrays and Yea I see that return thing now in the help file, hmm.. Thanks again. How am I ever going to get it to record if I can't do mousepos on my own!! hehe :)

Link to comment
Share on other sites

Ok, I now understand how you guys did it (claps) ha :) And what was really throwing me off was like the line break commands ( just looked confusing) =).. But now I'm still having trouble of geting it to update in realtime , Like Puting it into a msg box and The coords display in that box as you move the mouse, The tooltip worked pretty good but it was just creating the tooltip over an over and caused some cursor lag.

I've tried puting it into the while loops but I find it just then creates the msgbox over and over. I've tried a couple diffrent things like guictrlsetdata etc.. But nothing seems to work, yea it displays or it gets caught in an infinite loop if you click the ok button it just re-displays and gives you the coords of the OK button (ouch)

Thanks for help

-Tokey

Link to comment
Share on other sites

Ok, I now understand how you guys did it (claps) ha :P And what was really throwing me off was like the line break commands ( just looked confusing) =).. But now I'm still having trouble of geting it to update in realtime , Like Puting it into a msg box and The coords display in that box as you move the mouse, The tooltip worked pretty good but it was just creating the tooltip over an over and caused some cursor lag.

I've tried puting it into the while loops but I find it just then creates the msgbox over and over. I've tried a couple diffrent things like guictrlsetdata etc.. But nothing seems to work, yea it displays or it gets caught in an infinite loop if you click the ok button it just re-displays and gives you the coords of the OK button (ouch)

Thanks for help

-Tokey

Two possible options: Change the message to a TrayTip() so it won't follow the mousepointer around:

For $n = 1 To 60
     $XCoord = MouseGetPos(0)
     $YCoord = MouseGetPos(1)
     TrayTip("Result",  "X = " & $XCoord & @LF & "Y = " & $YCoord, 30)
     Sleep(500)
Next

Or, you can create a custom GUI and update its position to follow the mousepointer (or whatever you want it to do). This option involves much more code and more new concepts, but will be highly customizable -- not the first thing I would recommend for one of your first scripts, but if you want to give it a try, start with tutorials for GUIs, like in Valuater's AutoIT 1-2-3 (link in my sig below).

As always, don't be afraid to post your broken code and get help with it.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Two possible options: Change the message to a TrayTip() so it won't follow the mousepointer around:

For $n = 1 To 60
     $XCoord = MouseGetPos(0)
     $YCoord = MouseGetPos(1)
     TrayTip("Result",  "X = " & $XCoord & @LF & "Y = " & $YCoord, 30)
     Sleep(500)
Next

Or, you can create a custom GUI and update its position to follow the mousepointer (or whatever you want it to do). This option involves much more code and more new concepts, but will be highly customizable -- not the first thing I would recommend for one of your first scripts, but if you want to give it a try, start with tutorials for GUIs, like in Valuater's AutoIT 1-2-3 (link in my sig below).

As always, don't be afraid to post your broken code and get help with it.

:)

That code helped me out, thanks.
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...