VVind0wM4ker Posted January 6, 2015 Share Posted January 6, 2015 Hello! I was searching for this in the internet but the closest solution I found was a thread in this forum: '?do=embed' frameborder='0' data-embedContent>> So i want to do mousemove/mouseclick by only using one variable. Instead of Mouseclick(123, 456, 1, 0) i would like to do Mouseclick($theplace, 1, 0) ;~ But of course it does not work to just define variable like this: $theplace = "123, 456" in the old thread somebody suggested $COORD=stringsplit("300,400",","); auto creates 3 dimention array with $COORD[1]=300, $CHORD[2]=400 MouseMove($COORD[1],$CHORD[2]) or $COORD=stringsplit("300,400",",") MouseMove($COORD[1],$CHORD[2],0); I like it to move very fast. But a i said i want to know if there is a way to do it without having to put in same var two times... Just MouseMove($thisplace, 0) Would be happy about any solutions Link to comment Share on other sites More sharing options...
JohnOne Posted January 6, 2015 Share Posted January 6, 2015 Write a wrapper function. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted January 6, 2015 Moderators Solution Share Posted January 6, 2015 VVind0wM4ker,Welcome to the AutoIt forums. Just create your own function to wrap the standard MouseClick: $theplace = "123|456" _MyMouseClick($theplace, 1, 0) Func _MyMouseClick($sPos, $iNumber = 1, $iSpeed = 0) ; Split the value $aPos = StringSplit($sPos, "|") ; Call the normal function MouseClick($aPos[1], $aPos[2], $iNumber, $iSpeed) EndFuncPlease ask if you have any questions. M23 VVind0wM4ker 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
jdelaney Posted January 6, 2015 Share Posted January 6, 2015 one example Local $array[5] = ["Left",123,456,1,100] MouseClick_Array($array) Func MouseClick_Array($a) If UBound($a)<>5 MouseClick($a[0],$a[1],$a[2],$a[3],$a[4]) EndFunc IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
VVind0wM4ker Posted January 7, 2015 Author Share Posted January 7, 2015 Thanks Melba23! And you got me its my first post If there is no other way (but i already thought that) then this is fine I only have one Question: _MyMouseClick($theplace, 1, 0) Func _MyMouseClick($sPos, $iNumber = 1, $iSpeed = 0) If I start _MyMouseClick ($theplace, 1, 0) then i start it with 3 Arguments (is this called so?) but in the Func you overwrite them right ? i think it should be Func _MyMouseClick($sPos, $iNumber, $iSpeed) Or not? Cause $iNumber = 1 sets the var to 1 instead of setting it to the number, i started the function with Thanks also to all others who replied =) And yeah as you can see english is obviously not my mother language. sry Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2015 Moderators Share Posted January 7, 2015 VVind0wM4ker, Cause $iNumber = 1 sets the var to 1 instead of setting it to the number, i started the function withNo it does not. it will only set the value to 1 if you do not define the parameter when you call the function - run this small example and see the results: #include <MsgBoxConstants.au3> ; Call the function with no parameter _DefaultTest() ; And now pass a parameter _DefaultTest(3) Func _DefaultTest($iParam = 99) MsgBox($MB_SYSTEMMODAL, "Parameter", $iParam) EndFuncAll clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
VVind0wM4ker Posted January 7, 2015 Author Share Posted January 7, 2015 Melba23 Oh ok. I found the mistake (nothing happend when using the funktion). It was the missing Button which was why nothing happend. I think that should make it: $theplace = "123|456" _MyMouseClick("secondary", $theplace, 1, 10) Func _MyMouseClick($MouseButton, $sPos, $iNumber = 1, $iSpeed = 0) ; Split the value $aPos = StringSplit($sPos, "|") ; Call the normal function MouseClick($MouseButton, $aPos[1], $aPos[2], $iNumber, $iSpeed) EndFunc Thanks for your help VVind0wM4ker Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 7, 2015 Moderators Share Posted January 7, 2015 VVind0wM4ker, It was the missing Button which was why nothing happenedSorry about that. :blush:M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
VVind0wM4ker Posted January 8, 2015 Author Share Posted January 8, 2015 M23 So I think that was it. You know im pretty new here so I have a last Question: There is a "Mark Solved" Button. Will this button mark the thread as "Solved" or also the Post (the one where i clicked the Button)? If 2nd would'nt it be good to make a final solution post an mark it. So other people who come here from google etc. quickly find the solution? Maybe this sounds weird but I have to ask. VVind0wM4ker Link to comment Share on other sites More sharing options...
JohnOne Posted January 8, 2015 Share Posted January 8, 2015 There is a "Mark Solved" Button. Will this button mark the thread as "Solved" or also the Post (the one where i clicked the Button)? Both. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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