TokeySmurf Posted September 10, 2006 Share Posted September 10, 2006 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 More sharing options...
Moderators SmOke_N Posted September 10, 2006 Moderators Share Posted September 10, 2006 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 More sharing options...
ramadash Posted September 10, 2006 Share Posted September 10, 2006 (edited) mousepos return an array: $MousePos = MouseGetPos() $MousePosX = $MousePos[0] $MousePosY = $MousePos[1] Edited September 10, 2006 by ramadash Link to comment Share on other sites More sharing options...
TokeySmurf Posted September 10, 2006 Author Share Posted September 10, 2006 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 Link to comment Share on other sites More sharing options...
dandymcgee Posted September 10, 2006 Share Posted September 10, 2006 I'm not much of one for copying and pastingYou just mean you'd rather learn it the hard way by reading help files that way you understand what you are using in your script? Me too. - Dan [Website] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 10, 2006 Moderators Share Posted September 10, 2006 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 hehI 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 More sharing options...
PsaltyDS Posted September 10, 2006 Share Posted September 10, 2006 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 More sharing options...
TokeySmurf Posted September 10, 2006 Author Share Posted September 10, 2006 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 More sharing options...
TokeySmurf Posted September 10, 2006 Author Share Posted September 10, 2006 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 More sharing options...
PsaltyDS Posted September 10, 2006 Share Posted September 10, 2006 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 -TokeyTwo 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 More sharing options...
Aortal Posted September 15, 2006 Share Posted September 15, 2006 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 More sharing options...
PsaltyDS Posted September 15, 2006 Share Posted September 15, 2006 That code helped me out, thanks.Just a point taken from the help file, but you're welcome. 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now