Jump to content

PKG

Active Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by PKG

  1. Use this code. #include <ImageSearch.au3> $x = 0 $y = 0 $NUM = 0 While $NUM <= 10 start() Sleep(10) WEnd Func start() Do $Search = _ImageSearch('pic.bmp', 0, $x, $y, 0) If $Search = 0 Then Sleep(1000) Until $Search = 1 If $Search = 1 Then MouseMove($x, $y, 10) MouseClick("left", $x, $y, 1) EndIf EndFunc ;==>start
  2. Use This... FileRecycle(@DesktopCommonDir & "*.txt")
  3. Yes...after searching the forum, I find that Autoit 3.3.8.1 Works fine in win 8. Thanks slipsystem.. Thanks Mat..for this information.
  4. It is just an Experiment. Thanks Water.
  5. Hi. I want to know that how can i terminate a running script from another script. I use ShellExecute() to run script and I want to stop it when i press "Stop" button. ;It is the 1st Script... #include<GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $PixFlag = False Global $WinScrStart, $WinScrStop FileInstall("ScrPix.au3", "", 1) WinMain() Func WinMain() GUICreate("WinApp-1.0", 550, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "WinExit") $WinScrStart = GUICtrlCreateButton("&Start(Win)", 40, 420, 80, 30) GUICtrlSetOnEvent(-1, "PixCtrl") $WinScrStop = GUICtrlCreateButton("&Stop(Win)", 130, 420, 80, 30) GUICtrlSetOnEvent(-1, "PixCtrl") GUISetState() While 1 Sleep(10) If $PixFlag = True Then FullPixSave() EndIf WEnd Return (0) EndFunc ;==>WinMain Func WinExit() Exit 0 EndFunc ;==>WinExit Func PixCtrl() Switch @GUI_CtrlId Case $WinScrStart $PixFlag = True Case $WinScrStop $PixFlag = False EndSwitch Return EndFunc ;==>PixCtrl Func FullPixSave() ShellExecute("ScrPix.au3") Return EndFunc ;==>FullPixSave ;It is the 2nd Script... #include <ScreenCapture.au3> WinPixStartSave() Func WinPixStartSave() While 1 Local $FileName $FileName = @WorkingDir & "\" & @HOUR & @MIN & @SEC & "WinScr.jpg" _ScreenCapture_CaptureWnd($FileName, WinGetHandle("", "")) Sleep(1000) WEnd Return EndFunc ;==>WinPixStartSave When i run the second script, It uses 100% CPU. How can i Fix it ? Thanks in Advance.
  6. Thanks KaFu ..... AMT - Auto-Movie-Thumbnailer (2013-Mar-22) and SMF - Search my Files (2013-Apr-25) - THE file info and duplicates search tool AWESOME!!! KaFu....... :thumbsup:
  7. Welcome to AutoIt and the forum!... Have you looked at the title="">FireFox UDF ?
  8. thanks everyone for your help...
  9. That was just an example script.....I use this coding style for my scripts......I just want to know that, is it a good coding style ?
  10. Here is an example script.... Should I use this coding style ? #include<GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) Global $FL = False Global $StopButton, $RunButton, $MyEditBox main() Func main() Local $MainForm = GUICreate("Win_App-1", 550, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "WinExit") $MyEditBox = GUICtrlCreateEdit("", 5, 30, 540, 270) GUICtrlSetBkColor($MyEditBox, 0xFF6347) $RunButton = GUICtrlCreateButton("&Run", 120, 420, 70, 30) GUICtrlSetOnEvent($RunButton, "Run_DataLoop") $StopButton = GUICtrlCreateButton("&Stop", 200, 420, 70, 30) GUICtrlSetOnEvent($StopButton, "Run_DataLoop") GUISetState() While 1 If $FL Then DataLoop() EndIf Sleep(10) ; Look for the flag WEnd Return EndFunc ;==>main Func WinExit() Exit 0 EndFunc ;==>WinExit Func Run_DataLoop() Switch @GUI_CtrlId Case $RunButton $FL = True Case $StopButton $FL = False EndSwitch Return EndFunc ;==>Run_DataLoop Func DataLoop() GUICtrlSetBkColor($MyEditBox, 0x008000) While $FL ToolTip("Func Running") Sleep(10) WEnd ToolTip("Function Stopped") GUICtrlSetBkColor($MyEditBox, 0xFF6347) Sleep(500) ToolTip("") Return EndFunc ;==>DataLoop
  11. Hi everyone... I want to know that, how to improve my script's performance ? Should I use less comments and white space to improve performance ? I use C/C++ 's coding style for my script......use a "main" function, use return keyword within functions, explicitly declare variables.....etc. Is it a bad coding style ? Thanks in advance...
  12. Thanks JLogan3o13.... I Fixed It.... Now it will run forever... :ILA2:
  13. Thank Yashied. Cool GUI...
  14. Thanks... Melba23. this works for me too.
  15. Here is my Code... #include<GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $FL = True Local $MainForm = GUICreate("Win_App-1", 550, 500) GUISetOnEvent($GUI_EVENT_CLOSE, "WinExit") Global $MyEditBox = GUICtrlCreateEdit("", 5, 30, 540, 270) GUICtrlSetBkColor($MyEditBox, 0xFF6347) Global $RunButton = GUICtrlCreateButton("&Run", 120, 420, 70, 30) GUICtrlSetOnEvent($RunButton, "DataLoop") Global $StopButton = GUICtrlCreateButton("&Stop", 200, 420, 70, 30) GUICtrlSetOnEvent($StopButton, "DataLoop") GUISetState() While 1 Sleep(10) WEnd Func WinExit() Exit 0 EndFunc ;==>WinExit Func StopLoop() $FL = False EndFunc Func DataLoop() While $FL If HotKeySet("A") = 1 Then MsgBox(0,"Key","It is A") ElseIf HotKeySet("B") = 1 Then MsgBox(0,"Key","It is B") EndIf WEnd Return EndFunc ;==>DataLoop I want that, when the user click on Run Button then the loop will be started and when the user click on the Stop button then the loop will be stop. Will you plz show me that what is the error in this Code and how to fix it ?
  16. Can you Plz show me the code in OnEvent Mode ? I used flag and wrapper function but no luck. :'(
  17. Hi. How to break a infinite loop by an Event ? My Code... Global $StopButton = GUICtrlCreateButton("&Stop", 430, 420, 70, 30) Global $stopButtonRC = GUICtrlSetOnEvent($StopButton, "Stop") Func Stop() While 1 ;........... WEnd EndFunc Thanks in Advance.
  18. Sorry for posting in "Developer Chat". All clear. Thanks Melba23.
  19. Hi I create a menu item to call a function to show a MsgBox()...but it is not warking.... Plz help me to fix it...here is my code Thanks in advance. $HelpMenu = GUICtrlCreateMenu("&Help") $TitsMenu = GUICtrlCreateMenuItem("T&ips", $HelpMenu) GUICtrlSetOnEvent($HelpMenu, "AppTips") Func AppOption() MsgBox(0, "aaa", "dfghjkl") EndFunc ;==>AppOption
  20. :thumbsup: :thumbsup: While 1 MsgBox(0, "Thanks...", "Thanks AutoIt Team!") WEnd
  21. Thanks ...guinness , water. for helping me.
  22. because i want to install windows 8 and i also want to use Autoit.
  23. I have windows 7 only.I use autoit 3.3.8.1 .
  24. Can i use AutoIt 3 in windows 8 ?
×
×
  • Create New...