Jump to content

Need Help With Script


 Share

Recommended Posts

Ok I'm Attempting To Make A program That Will Loop Holding SHIFT And Left Clicking, I Want To Make It Loop Untill Hotkey Is Pressed Or I Go Out Of The Window, So Far I'm Having Problems With The Sleep And The Hotkey lol Any Help Would Be Great

#include <GUIConstants.au3>
$Test = GUICreate("test", 160 , 25)
$Go = GUICtrlCreateButton("Go", 0, 0, 80, 25, 0)
$Stop = GUICtrlCreateButton("Stop", 80, 0, 80, 25, 0)
GUISetState(@SW_SHOW)
sleep(100)
While 1
    $Msg = GUIGetMsg()
If Not WinActive($Test,"") Then Send("{SHIFTUP}")
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Go
            $i = 0
   Do
                While 1
     Send("{SHIFTDOWN}")
     MouseClick("Left")
                    ToolTip($i , 0 , 0)
                    $i = $i +1
                WEnd
            Until GUIGetMsg() = $Stop
        Case $Stop
            MsgBox(0 , "" , "Stop")   
   Send("{SHIFTUP}")
    EndSwitch
WEnd
Link to comment
Share on other sites

  • Developers

Think you are being LOOP CRAZY here!! look at it when ran through Tidy:

While 1
    $Msg = GUIGetMsg()
    If Not WinActive($Test, "") Then Send("{SHIFTUP}")
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Go
            $i = 0
            Do
                While 1
                    Send("{SHIFTDOWN}")
                    MouseClick("Left")
                    ToolTip($i, 0, 0)
                    $i = $i + 1
                WEnd
            Until GUIGetMsg() = $Stop
        Case $Stop
            MsgBox(0, "", "Stop")
            Send("{SHIFTUP}")
    EndSwitch
WEnd

How will it ever leave the While within the DO loop ??

Edited by 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.
  :)

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