Jump to content

Repeat Commands


Recommended Posts

Hi guys i am new at scripting. i make a script. but i dont know how to repeat the commands after sleep. . here is the script :

While 1
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
             
        Case $Button1
            MouseClick ("left",718,465)
            MouseWheel("down", 4)
            MouseClick ( "left",726,800)
            
            Send("upupupupupupupu updullah upupupupuppuup")
            MouseWheel("down", 1)
        MouseClick ( "left",285,840)
        Sleep(3000)
        
        
            

     Case $Button2
         MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafından kodlanmıştır")
        Exit
        
        Case $Label1
    EndSwitch
WEnd

Its turkish :) How can i do that ? Please help me...

Edited by vandan2
Link to comment
Share on other sites

Something like this ?

$_State = False

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $_State = Not $_State
        Case $Button2
            MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafindan kodlanmistir")
            Exit
        Case $Label1
            
    EndSwitch
    If $_State Then _Action ( )
WEnd

Func _Action ( )
    MouseClick ("left",718,465)
    MouseWheel("down", 4)
    MouseClick ( "left",726,800)
    Send("upupupupupupupu updullah upupupupuppuup")
    MouseWheel("down", 1)
    MouseClick ( "left",285,840)
    Sleep(3000)
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

now its and not working please fix

$_State = False

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $_State = Not $_State
        Case $Button2
            MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafindan kodlanmistir")
            Exit
        Case $Label1
            
    EndSwitch
    If $_State Then _Action ( )
WEnd

Func _Action ( )
    MouseClick ("left",718,465)
    MouseWheel("down", 4)
    MouseClick ( "left",726,800)
    Send("upupupupupupupu updullah upupupupuppuup")
    MouseWheel("down", 1)
    MouseClick ( "left",285,840)
    Sleep(3000)
EndFunc

        
        
            

     Case $Button2
         MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafından kodlanmıştır")
        Exit
        
        Case $Label1
    EndSwitch
WEnd
Edited by vandan2
Link to comment
Share on other sites

guys look at me again. i want to repeat all comands in script. here the clean script. its working but i want to do it all over again. all commands. thats the all codes :

wakillon your script is right its working without the button 2. please fix it and give me again

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("İnci Sözlük Entry Uplayıcı ", 341, 250, 453, 143)
$Button1 = GUICtrlCreateButton("Çalıştır !", 232, 8, 97, 113, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Dur Amk ! ", 224, 136, 113, 65, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Yazılacak Kelimeyi Alt Kısma Yaz Panpa", 0, 56, 230, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("up up up up updullah up up up up", 8, 80, 185, 21)
$Label2 = GUICtrlCreateLabel("Bu program totolaraskina tarafindan kodlanmıştır. Her hakkı saklıdı", 8, 216, 380, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)



While 1
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
             
        Case $Button1
            MouseClick ("left",718,465)
            MouseWheel("down", 4)
            MouseClick ( "left",726,800)
            
            Send("upupupupupupupu updullah upupupupuppuup")
            MouseWheel("down", 1)
        MouseClick ( "left",285,840)
        Sleep(3000)
        
        
            

     Case $Button2
         MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafından kodlanmıştır")
        Exit
        
        Case $Label1
    EndSwitch
WEnd
Link to comment
Share on other sites

Try this way

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Inci Sözlük Entry Uplayici ", 341, 250, 453, 143)
$Button1 = GUICtrlCreateButton("Çalistir !", 232, 8, 97, 113, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Dur Amk ! ", 224, 136, 113, 65, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Yazilacak Kelimeyi Alt Kisma Yaz Panpa", 0, 56, 230, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("up up up up updullah up up up up", 8, 80, 185, 21)
$Label2 = GUICtrlCreateLabel("Bu program totolaraskina tarafindan kodlanmistir. Her hakki saklidi", 8, 216, 380, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)

$_State = False

While 1
    
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
            
        Case $Button1
            $_State = Not $_State
            If $_State Then
                AdlibRegister ( '_Action', 3000 )
            Else
                AdlibUnRegister ( '_Action' )
            EndIf
    Case $Button2
        MsgBox (0, "Kodlayan" , "Bu program totolaraskina tarafindan kodlanmistir")
        Exit
        
        Case $Label1
    EndSwitch
WEnd

Func _Action ( )
    MouseClick ("left",718,465)
    MouseWheel("down", 4)
    MouseClick ( "left",726,800)
    Send("upupupupupupupu updullah upupupupuppuup")
    MouseWheel("down", 1)
    MouseClick ( "left",285,840)
EndFunc
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Like this ?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

HotKeySet ( "{ESC}", "_Exit" )

$Form1 = GUICreate("Inci Sözlük Entry Uplayici ", 341, 250, 453, 143)
$Button1 = GUICtrlCreateButton("Çalistir !", 232, 8, 97, 113, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Dur Amk ! ", 224, 136, 113, 65, $WS_GROUP)
$Label1 = GUICtrlCreateLabel("Yazilacak Kelimeyi Alt Kisma Yaz Panpa", 0, 56, 230, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
$Input1 = GUICtrlCreateInput("up up up up updullah up up up up", 8, 80, 185, 21)
$Label2 = GUICtrlCreateLabel("Bu program totolaraskina tarafindan kodlanmistir. Her hakki saklidi", 8, 216, 380, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)

$_State = False

While 1

    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            _Exit ( )
        Case $Button1
            $_State = Not $_State
            If $_State Then
                AdlibRegister ( '_Action', 3000 )
            Else
                AdlibUnRegister ( '_Action' )
            EndIf
        Case $Button2
            MsgBox ( 0, "Kodlayan" , "Bu program totolaraskina tarafindan kodlanmistir" )
            _Exit ( )
        Case $Label1

    EndSwitch
WEnd

Func _Action ( )
    MouseClick ("left",718,465)
    MouseWheel("down", 4)
    MouseClick ( "left",726,800)
    Send("upupupupupupupu updullah upupupupuppuup")
    MouseWheel("down", 1)
    MouseClick ( "left",285,840)
EndFunc

Func _Exit ( )
    GUIDelete ( $Form1 )
    AdlibUnRegister ( '_Action' )
    Exit
EndFunc
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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