yous Posted May 10, 2011 Share Posted May 10, 2011 Hi Guys I'm new to this forum and I need your expertise, I'm looking for a script that allows me to click on button in XY coordination when a mouse got clicked in another XY coordination. Basically, I have a hidden keyboard that I would like show to a user when a search button get clicked and then hid it when the go button get clicked. Thanks in advance Link to comment Share on other sites More sharing options...
JohnOne Posted May 10, 2011 Share Posted May 10, 2011 You do not need XY to click a button, your need is hard to understand. Please explain a little further, perhaps an example code. 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...
yous Posted May 10, 2011 Author Share Posted May 10, 2011 You do not need XY to click a button, your need is hard to understand.Please explain a little further, perhaps an example code.I have an interactive application in kiosk mode that our customers uses to search for article number using a keyboard (hardware) even though we have a touch screen. My idea is to get rid of that keyboard(hardware) and launch a onscreen keyboard at startup. I don't have the original code for that application to integrate the onscreen keyboard. This onscreen keyboard have a key that allows me to hide and show the keyboard.So, I want the mouse to click on the showKeyboard button when a customer press the search button on my application and than another mouse click to hide the keyboard when the same customer press OK button. Unfortunatly I don't have an example code and I searched everywhere.The attached is a print screen of my keyboard Link to comment Share on other sites More sharing options...
JohnOne Posted May 10, 2011 Share Posted May 10, 2011 So this "interactive application", is it a web application? I ask because you mention "kiosk mode". 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...
yous Posted May 10, 2011 Author Share Posted May 10, 2011 So this "interactive application", is it a web application? I ask because you mention "kiosk mode".It's not a web base application. Its a VBNET package and its sitting on c drive. Link to comment Share on other sites More sharing options...
monoscout999 Posted May 10, 2011 Share Posted May 10, 2011 search on the help the functions... mouseclick() controlclick() maybe that is what you want Link to comment Share on other sites More sharing options...
yous Posted May 10, 2011 Author Share Posted May 10, 2011 I know how to use a mouseclick function I just don't know how to tell the script to wait for an action from a user. I keep getting error when I tried the IF statement. Link to comment Share on other sites More sharing options...
kaotkbliss Posted May 10, 2011 Share Posted May 10, 2011 How are you setting up your "If" statement? While 1 If _IsPressed(01) Then RunFunction() EndIf Wend 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
yous Posted May 10, 2011 Author Share Posted May 10, 2011 How are you setting up your "If" statement? While 1 If _IsPressed(01) Then RunFunction() EndIf Wend Ĥere is an example code I tried AutoItSetOption("MouseCoordMode", 2) AutoItSetOption("TrayIconDebug", 1) Func MouseBezier($x,$y) while 1 $pos = MouseGetPos() if $pos[$x]= 1010 and $pos[$y]= 1141 Then MouseClick("left",1015,1241,1,1) EndIf WEnd EndFunc Link to comment Share on other sites More sharing options...
kaotkbliss Posted May 10, 2011 Share Posted May 10, 2011 It's not going to be $pos[$x] and $pos[$y] it will be $pos[0] and $pos[1] as mousegetpos returns [0] = x and [1] = y 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
yous Posted May 10, 2011 Author Share Posted May 10, 2011 (edited) It's not going to be $pos[$x] and $pos[$y] it will be $pos[0] and $pos[1] as mousegetpos returns [0] = x and [1] = y In the code below I defined the XY coordination and it works like a charm. What's the best way to set a range of XY to cover the whole button area. AutoItSetOption("MouseCoordMode", 2) AutoItSetOption("TrayIconDebug", 1) while 1 $pos = MouseGetPos() ToolTip($pos) if $pos[0]= 160 and $pos[1]= 44 Then MouseClick("left",1015,1241,1,1) EndIf WEnd Edited May 10, 2011 by yous Link to comment Share on other sites More sharing options...
JohnOne Posted May 10, 2011 Share Posted May 10, 2011 (edited) Something like this. If $pos[0] >= $buttonposleft And $pos[0] <= $buttonposright And $pos[1] >= $buttonpostop And $pos[1] <= $buttonposbottom Then Edited May 10, 2011 by JohnOne 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