Guest GrimGremlin Posted July 12, 2004 Share Posted July 12, 2004 OK when i get to the "installer" window and press the End key nothing happens. Any help would be greatly appreciated AutoItSetOption("MouseClickDelay", 75) WinWaitActive ("Installer") HotKeySet("{End}", "onkeydown") Func onkeydown() MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 430, 390, 0) MouseClick("left", 375, 390, 0) EndFunc Link to comment Share on other sites More sharing options...
Proof Posted July 12, 2004 Share Posted July 12, 2004 (edited) MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 430, 390, 0) MouseClick("left", 375, 390, 0)With your code you set the number of times the button is clicked to ZERO, not the SPEED. MouseClick ( "button" [, x, y [, clicks [, speed ]]] ) I guess you wanted to set the mouse to move instantly (speed = 0), but than you have to set the clicks by hand, so the parser gets what you mean. In general you have to set all the options from left to right, even if you just want to change the last one on the right and keep the rest on default values. See the AutoIt Helpfile under Function Reference / Function Notes MouseClick("left", 375, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) MouseClick("left", 430, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) Edited July 12, 2004 by Proof Link to comment Share on other sites More sharing options...
Guest GrimGremlin Posted July 12, 2004 Share Posted July 12, 2004 Wow I'm stupid. I tried that but now the script just closes when end is hit. Also it doesnt click anywhere. Link to comment Share on other sites More sharing options...
Proof Posted July 12, 2004 Share Posted July 12, 2004 You sure, that no buttons are clicked? Maybe they just don`t hit the buttons you want them to. I try to avoid MouseClicks when possible. Let a MsgBox or something pop open, when you hit END, so you know that it basically works. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2004 Developers Share Posted July 12, 2004 OK when i get to the "installer" window and press the End key nothing happens. Any help would be greatly appreciated AutoItSetOption("MouseClickDelay", 75) WinWaitActive ("Installer") HotKeySet("{End}", "onkeydown") Func onkeydown() MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 430, 390, 0) MouseClick("left", 375, 390, 0) EndFuncYour script ends after the WinWaitActive ("Installer") line. That means that when this window exists and gets the focus, your script sets the HotKey and then right away ends. 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. Link to comment Share on other sites More sharing options...
Guest GrimGremlin Posted July 12, 2004 Share Posted July 12, 2004 Your script ends after the WinWaitActive ("Installer") line. That means that when this window exists and gets the focus, your script sets the HotKey and then right away ends.How do I get it to stay active? Link to comment Share on other sites More sharing options...
Developers Jos Posted July 12, 2004 Developers Share Posted July 12, 2004 How do I get it to stay active?dunno what you want exactly but this example stays active til the END key is pressed: Global $StayAct=1 AutoItSetOption("MouseClickDelay", 75) WinWaitActive ("Installer") HotKeySet("{End}", "onkeydown") While $StayAct=1 Sleep(10) Wend Func onkeydown() MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 375, 390, 0) MouseClick("left", 430, 390, 0) MouseClick("left", 375, 390, 0) $StayAct=0 EndFunc 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. Link to comment Share on other sites More sharing options...
w_sp8er Posted July 12, 2004 Share Posted July 12, 2004 (edited) Can you post your current code? Ok, the way I'd do this is to add a 'While 1...WEnd', like this WinWaitActive ("Installer") HotKeySet("{End}", "onkeydown") While 1 Sleep(1000) WEnd Func onkeydown() MouseClick("left", 375, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) MouseClick("left", 430, 390, 1, 0) MouseClick("left", 375, 390, 1, 0) MsgBox(0, "Success!", "Success!") Exit EndFunc EDIT: Damn JdeB beat me to the punch, JdeB's choice looks a little more complex than it could be. BUT if it works, well... Edited July 12, 2004 by w_sp8er 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