Jump to content
Sign in to follow this  
sd333221

Help i am a noob :)

Recommended Posts

sd333221

Hello,

i downloaded the newest version of Autoit and i set up

a code. I want a script which i can activate and stop with

the pause key. I want it to press left mouse key, press

arrow down, enter, enter. Wait 1 secound and then repeat.

this is what i got

;Script
;Activation
$answer = MsgBox(4, "Script", "Do you want to activate the script?.  Run?")
If $answer = 7 Then
    MsgBox(0, "AutoIt", "OK.  Bye!")
    Exit
EndIf
;Activate Windows
WinActivate("Firefox")
;hotkey
....
;Main function
MouseClick("left")
Send("{ENTER}")
Send("{DOWN}")
Send("{ENTER}")
Send("{ENTER}")

but its not complete.

I NEED YOUR HELP.

It would be very kind if you could complete the code!!!!!

thanks :(

Share this post


Link to post
Share on other sites
buzz44

Help File...

  • HotKeySet()
  • Loop Statements

qq

Share this post


Link to post
Share on other sites
sd333221

; Press Esc to terminate script, Pause/Break to "pause"

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d

;;;; Body of program would go here;;;;
    Sleep(100)
MouseClick("left", 1041, 423, 2)
    Sleep(100)
Send("aeroclient.exe{DOWN}")
    Sleep(100)
Send("aeroclient.exe{Enter}")
    Sleep(100)
Send("aeroclient.exe{Enter}")
    Sleep(100)
;;;;;;;;

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","Thank you for using the 
]script!")
EndFunc

it still doesnt work plz help!

Edited by sd333221

Share this post


Link to post
Share on other sites
buzz44

Obviously you didn't bother to thouroughly look at "Loop Statements". As I provided sufficient information I will not bother repeating myself.


qq

Share this post


Link to post
Share on other sites
sd333221

Obviously you didn't bother to thouroughly look at "Loop Statements". As I provided sufficient information I will not bother repeating myself.

<{POST_SNAPBACK}>

Sorry but i couldnt find the file,

where is it located? :(

Share this post


Link to post
Share on other sites
buzz44

????... The Help File. I know you were in it because of your new script with the HotKeySet's. Open the help file, and click the "Index" tab... then type "Loop Statements" .


qq

Share this post


Link to post
Share on other sites
sd333221

Ok my final script is:

; Press Esc to terminate script, Pause/Break to "pause"
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d
; Initial shit
WinActivate("Firefox")
;;;; Body of program;;;;
$i = 0
Do
MouseClick("left")
Send("{Enter}")
sleep(300)
Send("{Enter}")
sleep(300)
Send("{DOWN}")
Send("{Enter}")
sleep(300)
Send("{Enter}")
sleep(300)
Send("{Enter}")
Sleep(100)
$i = $i + 1
Until $i = 10000

;;;;;;;;
Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","Thank you for using, the script.")
EndFunc

I added "sleep(300)" commands but he doesnt sleep, he klicks

too fast. How can i make him wait? Thanks for ur great help :()

Share this post


Link to post
Share on other sites
steveR

well you could use SendKeyDelay (look it up under the keyboard functions) or you could increase the sleep() time. remember time is in milliseconds, so 3000 would be 3 seconds


AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass.

Share this post


Link to post
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
Sign in to follow this  

×