KenNichols Posted February 19, 2011 Share Posted February 19, 2011 This script works good but I get the following message after a few minutes. Line 54 (File "C:\Program Files (x86)\Automatic Access\Automatic Access.exe"): Error: Recursion level has been exceeded - AutoIt will quit to prevent stack overflow. I have read other posts about this message and I have changed the script several times to try to fix it. However for some reason I can't wrap my head around this problem. What am I doing wrong? expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=Internet.ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_Description=Automation utility for VZ Access Manager #AutoIt3Wrapper_Res_Fileversion=1.1.0.0 #AutoIt3Wrapper_Res_LegalCopyright=© 2011 Ken Nichols #AutoIt3Wrapper_Res_Language=1033 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include<Misc.au3> If _Singleton(@ScriptName,1) = 0 Then Exit MsgBox(48,"","Automatic Access is already running.",3) If @Compiled = 1 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 0 Or @Compiled = 1 And FileExists(@StartupDir & "\Automatic Access.lnk") = 0 Then $Install = MsgBox(32+4,"Automatic Access","Do you want to install Automatic Access?") Select Case $Install = 6 _Install() MsgBox(64,"Automatic Access","Automatic Access is now installed.") Case $Install = 7 MsgBox(16,"Automatic Access","Automatic Access installation was cancelled!") Exit Case Else MsgBox(0,"Else","Else") EndSelect EndIf If FileExists(@ProgramFilesDir & "\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe") Then $VZDir = @ProgramFilesDir & "\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe" ElseIf FileExists(@ProgramFilesDir & " (x86)\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe") Then $VZDir = @ProgramFilesDir & " (x86)\Verizon Wireless\VZAccess Manager\VZAccess Manager.exe" EndIf ProcessSetPriority(@AutoItPID,1);Set Priority to "Below Normal" While 1 Sleep(250) _VZDetect() WEnd Func _VZDetect() $var = DriveGetDrive( "CDROM" ) If NOT @error Then For $i = 1 to $var[0] $Label = DriveGetLabel($var[$i]) $Status = DriveStatus($var[$i]) If $Label = "VZAccess Manager" And $Status = "Ready" And ProcessExists("VZAccess Manager.exe") = 0 Then Run($VZDir) WinWait("VZAccess Manager","") If WinExists("AutoPlay","VZAccess Manager") Then WinClose("AutoPlay","VZAccess Manager") EndIf Sleep(200);Allow time for window to load While ControlCommand ("VZAccess Manager","", 1003,"IsEnabled","") = 0 ;And WinExists("VZAccess Manager","") = 1 Sleep(200) WEnd If WinExists("AutoPlay","VZAccess Manager") Then WinClose("AutoPlay","VZAccess Manager") EndIf Sleep(200) ControlClick("VZAccess Manager","",1003);Click Connect Sleep(2000) ControlClick("VZAccess Manager","",1046);Click Minimize - WinSetState ("VZAccess Manager","",@SW_MINIMIZE)Doesn't minimize to systray EndIf Next EndIf EndFunc Func _Install() If @Compiled = 1 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 0 Then FileCopy(@ScriptFullPath, @ProgramFilesDir & "\Automatic Access\", 9) ; Flag = 1 + 8 (overwrite + create target directory structure) Sleep(100) EndIf If @compiled = 1 And FileExists(@StartupDir & "\Automatic Access.lnk") = 0 And FileExists(@ProgramFilesDir & "\Automatic Access\" & @ScriptName) = 1 Then FileCreateShortcut(@ProgramFilesDir & "\Automatic Access\" & @ScriptName, @StartupDir & "\Automatic Access.lnk","","","",@ProgramFilesDir & "\Automatic Access\" & @ScriptName,"","0") Sleep(100) EndIf EndFunc [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
guinness Posted February 19, 2011 Share Posted February 19, 2011 (edited) This explains a little more about Recursion >> http://www.autoitscript.com/wiki/Recursion from Melba23. Use RunWait() and not Run() OR it could be the ControlCommand for the While..WEnd Loop. Edited February 19, 2011 by guinness 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 Link to comment Share on other sites More sharing options...
KenNichols Posted February 22, 2011 Author Share Posted February 22, 2011 This explains a little more about Recursion >> http://www.autoitscript.com/wiki/Recursion from Melba23.Use RunWait() and not Run() OR it could be the ControlCommand for the While..WEnd Loop.I added an IF statment in While 1 and so far so good. Thanks for the help. [topic="21048"]New to AutoIt? Check out AutoIt 1-2-3![/topic] Need to make a GUI? You NEED KODA FormDesigner! Link to comment Share on other sites More sharing options...
kylomas Posted February 22, 2011 Share Posted February 22, 2011 Ken, I don't see that you are using any "recursion" (unless it is happenning within the "controlcommand" as guinness seems to be suggesting). Have you tried identifying where your code is spending most of it's time? Also...just a suggestion...if you use "tidy" (CRLF-T) the code is easier to read. Please update this post with the solution when you find it! Thanks, kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
crashas Posted March 29, 2015 Share Posted March 29, 2015 (edited) Hello all. was testing one script but after a while got that recursion level exceeded thing. looked for info but since noob on this it only confuses me if some one can please help to sort this one. any advice would be great.know that game type scripts not allowed but think that this one is harmless.basically what i wanna do is get sound notifications if someone sends a private message that's all. <snip> Edited March 29, 2015 by Melba23 Code removed Link to comment Share on other sites More sharing options...
jchd Posted March 29, 2015 Share Posted March 29, 2015 For which game is it? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
crashas Posted March 29, 2015 Share Posted March 29, 2015 Wartune, the game has its own notifications but there's way to many bugs that includes sound issues so most of players same as my self got mute sounds. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 29, 2015 Moderators Share Posted March 29, 2015 crashasWelcome to the AutoIt forum. know that game type scripts not allowedCorrect. but think that this one is harmlessWrong. >There is absolutely no flex - game interaction scripts are not allowed. Thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts