IanN1990 Posted October 26, 2012 Share Posted October 26, 2012 (edited) In the help file it states 'Re-registering an already existing Adlib function will update it with a new time.'. Is there any way or Opt i could set to change this default behaviour? So Reregistering the same Adlib doesn't reset its timer ? **I have already looked in the Opt List but could not find anything. Is there a hidden list as well ? because i remember valik/jon making asking for new Opts a taboo due to fact there are thousands and many not used / work but in the help file i could only find like 30 @Guinness Also in the Help File for AdlibRegister. It states the return value is none but that's not true. It returns a 1 if successful and a 0 if unsuccessful *See i do help a little * ConsoleWrite(AdlibRegister("Function", 500) & @CRLF) ;Returns 1 as function exists ConsoleWrite(AdlibRegister("Function1", 500) & @CRLF) ;Returns 0 as function doesnt exist Sleep(750) Func Function() ConsoleWrite("A" & @crlf) EndFunc Edited October 26, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 26, 2012 Moderators Share Posted October 26, 2012 IanN1990,And just how is AutoIt supposed to know just where in the previous cycle the re-enabled Adlib is supposed to be? When you unregister an Adlib it is gone and all details of its previous existence no longer exist. Doing as you suggest would mean retaining a fair amount of information about each Adlib - not something that is likely to make the Devs very happy. I can think of one workaround which is to use a flag to make the Adlib function return immediately when called - that way you can keep it running throughout and the whole question becomes moot. Why do you want to keep the same timing anyway? 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...
IanN1990 Posted October 26, 2012 Author Share Posted October 26, 2012 (edited) Its only because i thought Adlibs are a very good way of keeping a timer, assuming it doesn't get re-enabled. See codes below. AdlibRegister("Test", 1000) While 1 sleep(250) WEnd Func Test() ConsoleWrite("One Second Timer has happened") AdlibUnRegister("Test") EndFunc but if at any timer the Adlib is recalled, then the timer is reset. Seen by code B where the timer is never called. While 1 AdlibRegister("Test", 1000) sleep(250) WEnd Func Test() ConsoleWrite("One Second Timer has happened") AdlibUnRegister("Test") EndFunc now as far as work arounds go one could do something like this. Local $Timer While 1 sleep(250) If Not $Timer Then $Timer = True AdlibRegister("Test", 1000) EndIf WEnd Func Test() $Timer = False ConsoleWrite("One Second Timer has happened" & @CRLF) AdlibUnRegister("Test") EndFunc but i wanted to check if there was a opt already in place to allow this kind of use for alib. *Even if it is a mad mans use * *Improved Version. Thanks for the idea Melba Local $Timer While 1 sleep(250) If Not $Timer Then $Timer = AdlibRegister("Test", 1000) WEnd Func Test() ConsoleWrite("One Second Timer has happened" & @CRLF) $Timer = AdlibUnRegister("Test") EndFunc Edited October 26, 2012 by IanN1990 Link to comment Share on other sites More sharing options...
guinness Posted October 26, 2012 Share Posted October 26, 2012 Thanks. I don't check every post, so please in future you could post in the help file thread located in the Developer section. 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...
IanN1990 Posted October 26, 2012 Author Share Posted October 26, 2012 Though i always keep my eyes out for anything in the help file, this being the first i found which shows how amazing it really is , if i find any others i will post it in the correct location, Sorry Link to comment Share on other sites More sharing options...
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