Jump to content

Please help a newbie


Guest GrimGremlin
 Share

Recommended Posts

Guest GrimGremlin

OK when i get to the "installer" window and press the End key nothing happens. Any help would be greatly appreciated :ph34r:

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

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 by Proof
Link to comment
Share on other sites

Guest GrimGremlin

Wow I'm stupid.

I tried that but now the script just closes when end is hit. Also it doesnt click anywhere. :ph34r:

Link to comment
Share on other sites

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

  • Developers

OK when i get to the "installer" window and press the End key nothing happens. Any help would be greatly appreciated :ph34r:

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
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.

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

Guest GrimGremlin

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

  • Developers

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

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 by w_sp8er
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...