Wyldfire Posted February 6, 2013 Posted February 6, 2013 (edited) Hello guys, I have trouble getting my script started. It runs without error but it does nothing. It is a very simple click bot using my browser to automate some mouseclicks. I am not trying to do anything too fancy. Just be able to Run it and Pause it with a button and Quit. I have made a working script before, but I've never used AU3Record before. I don't remember which tut I used long ago. I wish I did. expandcollapse popup;============================GLOBAL DECLARATIONS=================================================== Global $Paused HotKeySet('{HOME}', 'TogglePause') ;SCRIPT START HotKeySet('{END}', 'Quit') ;SCRIPT QUIT Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc AU3RecordSetup() ;============================GLOBAL DECLARATIONS=================================================== ;============================SCRIPT STARTED======================================================= While 1 Sleep(100) _WinWaitActivate("Start menu","All Programs") MouseClick("left",37,573,1) MouseClick("left",70,69,1) MouseClick("left",89,77,1) Sleep("1000") MouseClick("right",435,80,1) Sleep("1000") MouseClick("left",476,111,1) Sleep("1000") ;============================SITE 1======================================================= _WinWaitActivate("Jamba Juice - Chromium","Jamba Juice") MouseClick("left",492,768,1) Sleep("1000") MouseClick("left",639,747,1) MouseMove(284,292) Sleep("1000") MouseDown("left") MouseMove(255,765) MouseUp("left") Sleep("1000") MouseClick("left",256,8,1) ;============================SITE 2======================================================= _WinWaitActivate("Wise Foods - Chromium","Wise Foods") MouseClick("left",380,546,1) Sleep("1000") MouseClick("left",353,544,1) Sleep("1000") MouseClick("left",487,643,1) Sleep("1000") MouseClick("left",487,643,1) Sleep("1000") MouseClick("left",487,643,1) Sleep("1000") MouseClick("left",357,8,1) Sleep("1000") ;============================SITE 3======================================================= _WinWaitActivate("Orville Redenbacher's - Chromium","Orville Redenbacher'") MouseClick("left",375,465,1) Sleep("1000") MouseClick("left",463,8,1) Sleep("1000") Wend ;============================SITE 10======================================================= ;============================SITE 11======================================================= ;============================SITE 12======================================================= ;============================SITE 13======================================================= ;============================SITE 14======================================================= ;============================SITE 15======================================================= ;============================ SCRIPT ENDED ======================================================= ;============================ START/PAUSE / FUNCTIONS ======================================================= Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Quit() Exit EndFunc ;==>Quit Edited February 6, 2013 by Wyldfire
ileandros Posted February 6, 2013 Posted February 6, 2013 (edited) Your script is full of mistakes. I would recomend reading help files. expandcollapse popup;============================GLOBAL DECLARATIONS=================================================== Global $Paused HotKeySet('{HOME}', 'TogglePause') ;SCRIPT START HotKeySet('{END}', 'Quit') ;SCRIPT QUIT Func _Au3RecordSetup() Opt('WinWaitDelay',100) Opt('WinDetectHiddenText',1) Opt('MouseCoordMode',0) EndFunc Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _AU3RecordSetup() ;============================GLOBAL DECLARATIONS=================================================== ;============================SCRIPT STARTED======================================================= While 1 Sleep(100) _WinWaitActivate("Start menu","All Programs") MouseClick("left",37,573,1) MouseClick("left",70,69,1) MouseClick("left",89,77,1) Sleep(1000) MouseClick("right",435,80,1) Sleep(1000) MouseClick("left",476,111,1) Sleep(1000) ;============================SITE 1======================================================= _WinWaitActivate("Jamba Juice - Chromium","Jamba Juice") MouseClick("left",492,768,1) Sleep(1000) MouseClick("left",639,747,1) MouseMove(284,292) Sleep(1000) MouseDown("left") MouseMove(255,765) MouseUp("left") Sleep(1000) MouseClick("left",256,8,1) ;============================SITE 2======================================================= _WinWaitActivate("Wise Foods - Chromium","Wise Foods") MouseClick("left",380,546,1) Sleep(1000) MouseClick("left",353,544,1) Sleep(1000) MouseClick("left",487,643,1) Sleep(1000) MouseClick("left",487,643,1) Sleep(1000) MouseClick("left",487,643,1) Sleep(1000) MouseClick("left",357,8,1) Sleep(1000) ;============================SITE 3======================================================= _WinWaitActivate("Orville Redenbacher's - Chromium","Orville Redenbacher'") MouseClick("left",375,465,1) Sleep(1000) MouseClick("left",463,8,1) Sleep(1000) Wend ;============================SITE 10======================================================= ;============================SITE 11======================================================= ;============================SITE 12======================================================= ;============================SITE 13======================================================= ;============================SITE 14======================================================= ;============================SITE 15======================================================= ;============================ SCRIPT ENDED ======================================================= ;============================ START/PAUSE / FUNCTIONS ======================================================= Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc ;==>TogglePause Func Quit() Exit EndFunc ;==>Quit Edit: If it is a web browser automatation then take a look at _IE functions in the help files Edited February 6, 2013 by ileandros I feel nothing.It feels great.
water Posted February 6, 2013 Posted February 6, 2013 (edited) If you are running Internet Explorer I would suggest to have a look at the IE UDF which comes with AutoIt. This makes your script much more reliable! Edit: Just noticed that ileandros has given you the same advice. Edited February 6, 2013 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted February 6, 2013 Posted February 6, 2013 BTW: Please use descriptive thread titles. Eveone on the General Helpd and Support forum is looking for help. The better you describe your problem in the title the more people will be willing to open the thread ... My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
guinness Posted February 6, 2013 Posted February 6, 2013 What everyone else said plus the addition of use [autoit][/autoit] tags when displaying AutoIt code in the Forum. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
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