vandan2 Posted July 23, 2011 Posted July 23, 2011 (edited) 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 July 23, 2011 by vandan2
wakillon Posted July 23, 2011 Posted July 23, 2011 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.0 - WIN 8.1 X64 - Other Example Scripts
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 yeah thats it wakilion. but now i cant close the script. i cant stop it how can i stop can you give the code again ?
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 (edited) now its and not working please fix expandcollapse popup$_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 July 23, 2011 by vandan2
wakillon Posted July 23, 2011 Posted July 23, 2011 press again Button1 for change state of $_State and you can stop it ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 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 expandcollapse popup#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
wakillon Posted July 23, 2011 Posted July 23, 2011 (edited) Try this way expandcollapse popup#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 July 23, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 not working. when i pressed run ( çalıştır ) nothing happens.
wakillon Posted July 23, 2011 Posted July 23, 2011 Corrected Retry AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 Thank you verry much ! I have 1 more question. How can add an hot key to the button 2 like F8 ?
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 Yeah button 2 is exit. its working before press the run ( calistir ) but after i press run button 2 doest working. i thing we need to change exit to stop or etc ?
wakillon Posted July 23, 2011 Posted July 23, 2011 (edited) Like this ? expandcollapse popup#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 July 23, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 Sorry for my all flods but its important. There is only 1 problem left. I cant stop the program. When i pressed button 2 nothing happens.
vandan2 Posted July 23, 2011 Author Posted July 23, 2011 ow yeah man ! you are awesome problem solved. thanks for everything. !
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