Jump to content

AdlibRegister - Is there a Opt Available to change default behaviour


 Share

Recommended Posts

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 :D *See i do help a little :P*

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 by IanN1990
Link to comment
Share on other sites

  • Moderators

IanN1990,

And just how is AutoIt supposed to know just where in the previous cycle the re-enabled Adlib is supposed to be? :huh:

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? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 :D*

*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 by IanN1990
Link to comment
Share on other sites

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...