alongsnake Posted July 31, 2015 Posted July 31, 2015 The best example is MouseClick, where you have MouseClick($Button, [$x, $y, [..........]]) Where if X is set, Y must be set too.I do know how to make it so that X and Y are optional, but I am not sure how to get Y mandatory if X is set. I did check the help, but didn't see anything there.Thanks in advance
Developers Jos Posted July 31, 2015 Developers Posted July 31, 2015 No sure I understand the true issue here, but just do a simply with $y and $x in the Func itself and only make $x mandatory?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
alongsnake Posted July 31, 2015 Author Posted July 31, 2015 You know how you can do MouseClick and not specify a position argument? It will just click where ever the mouse is. If you want to specify a position, you have to specify both X and Y. It is optional to specify an X and Y, but if you do, they both have to be.
jguinch Posted July 31, 2015 Posted July 31, 2015 Something like this ?Func Function($x = Default, $y = Default) If ($x <> Default AND $y = Default) OR ($x = Default AND $y <> Default) Then Return SetError(1, 0, 0) ElseIf $x = Default Then ConsoleWrite("X and Y not set") Else ConsoleWrite("X and Y set") EndIf EndFunc Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
JohnOne Posted July 31, 2015 Posted July 31, 2015 _MouseClick(10) Func _MouseClick($x = 0, $y = 0) If @NumParams = 1 Then Return SetError(1) EndIf MsgBox(0,"Yay","Click mouse") EndFunc AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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