Nahuel Posted September 16, 2007 Share Posted September 16, 2007 Maybe this is a stupid quick question: Why can't I use AdlibEnable more than once? Example: AdlibEnable("func1",1000) AdlibEnable("func2",2000) Func func1() SplashTextOn("","This is func1",200,25,-1,-1,1) Sleep(500) SplashOff() EndFunc Func func2() SplashTextOn("","This is func2",200,25,-1,-1,1) Sleep(500) SplashOff() EndFunc While 1 Sleep(10) WEnd This will only call func2. Link to comment Share on other sites More sharing options...
Xenobiologist Posted September 16, 2007 Share Posted September 16, 2007 Hi, so you have to put the logic in the one func. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Nahuel Posted September 16, 2007 Author Share Posted September 16, 2007 Thanks but I'm not sure I get what you mean... Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted September 16, 2007 Share Posted September 16, 2007 He means that you should merge the code from both functions into one since it is not possible to have two adlibs on at the same time .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
wolf9228 Posted September 16, 2007 Share Posted September 16, 2007 (edited) Maybe this is a stupid quick question: Why can't I use AdlibEnable more than once? Example: AdlibEnable("func1",1000) AdlibEnable("func2",2000) Func func1() SplashTextOn("","This is func1",200,25,-1,-1,1) Sleep(500) SplashOff() EndFunc Func func2() SplashTextOn("","This is func2",200,25,-1,-1,1) Sleep(500) SplashOff() EndFunc While 1 Sleep(10) WEnd This will only call func2. Parameters function The name of the adlib function to call. time [optional] how often in milliseconds to call the function. Default is 250 ms. Return Value None. AdlibEnable("func1",1000) Func func1() SplashTextOn("","This is func1",200,25,-1,-1,1) Sleep(500) SplashOff() AdlibEnable("func2",2000) EndFunc Func func2() SplashTextOn("","This is func2",200,25,-1,-1,1) Sleep(500) SplashOff() AdlibEnable("func1",1000) EndFunc While 1 Sleep(10) WEnd Edited September 16, 2007 by wolf9228 صرح السماء كان هنا Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 17, 2007 Share Posted September 17, 2007 No need to modify the AdLibEnable() when it's called, just put the logic in the function to know what to do. This technique would allow an unlimited number of different timers: HotKeySet("{ESC}", "_Quit") AdlibEnable("_FuncX") Global $Timer_1 = TimerInit(), $Timer_2 = TimerInit() While 1 Sleep(10) WEnd Func _FuncX() If TimerDiff($Timer_1) >= 2000 Then _Func1() If TimerDiff($Timer_2) >= 5000 Then _Func2() EndFunc ;==>_FuncX Func _Func1() $Timer_1 = TimerInit() SplashTextOn("", "This is func1", 200, 25, -1, -1, 1) Sleep(500) SplashOff() EndFunc ;==>_Func1 Func _Func2() $Timer_2 = TimerInit() SplashTextOn("", "This is func2", 200, 25, -1, -1, 1) Sleep(500) SplashOff() EndFunc ;==>_Func2 Func _Quit() Exit EndFunc ;==>_Quit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Nahuel Posted September 17, 2007 Author Share Posted September 17, 2007 ^aahh awesome. Thanks a lot! 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