CrewXp Posted March 2, 2009 Share Posted March 2, 2009 damnit.. and here i thought it was really multi-threading.. grr. Tried to run 20 of these basically at the same time, but the next one wouldn't run unless the previous had returned from its function. grr.. going to look at CoProc that was mentioned here. Link to comment Share on other sites More sharing options...
Dampe Posted March 2, 2009 Share Posted March 2, 2009 Who says I'm crying? I'm just saying this isn't multithreading, so you can stop calling them threads. Use an other word instead: "function", I don't know if you've ever heard of it.Honestly, I think you're a little butthurt. We all know that they aren't threads, so stop flooding the topic with your whining about how the OPuses vocabulary.On topic:I think this is a good workaround.Keeps your mind in the game (Not having like, 50 things to worry about in the mainloop)Alot easier to program with this.Nice job. Link to comment Share on other sites More sharing options...
BrettF Posted March 2, 2009 Share Posted March 2, 2009 Honestly, I think you're a little butthurt. We all know that they aren't threads, so stop flooding the topic with your whining about how the OPuses vocabulary.On topic:I think this is a good workaround.Keeps your mind in the game (Not having like, 50 things to worry about in the mainloop)Alot easier to program with this.Nice job.How about we think of it this way. Would you call a motorbike a car? Sure, it does the same thing in terms of getting you from A to B, but one is a car, and one is a motor bike. Not the same are they?So yes, I'm on little butthurt kips' side.It is NOT multithreading, and there will probably never be multithreading in AutoIt, so stop wishing. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Dampe Posted March 3, 2009 Share Posted March 3, 2009 (edited) How about we think of it this way. Would you call a motorbike a car? Sure, it does the same thing in terms of getting you from A to B, but one is a car, and one is a motor bike. Not the same are they?So yes, I'm on little butthurt kips' side.It is NOT multithreading, and there will probably never be multithreading in AutoIt, so stop wishing.We all know that they aren't threadsI think this is a good workaroundCan you read my whole post next time before posting arguments that I agreed with? >_> Edited March 3, 2009 by Dampe Link to comment Share on other sites More sharing options...
BrettF Posted March 3, 2009 Share Posted March 3, 2009 I was whining about how the OP was using his vocab... I read all of the post as well, I just chose to ignore it.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Dampe Posted March 3, 2009 Share Posted March 3, 2009 I was whining about how the OP was using his vocab... I read all of the post as well, I just chose to ignore it.... Ah no prob, just wasn't following where you're thoughts were exactly coming from Link to comment Share on other sites More sharing options...
RagsRevenge Posted August 14, 2009 Share Posted August 14, 2009 thank you !! >_< please more comments. i am not sure about some details in the functions. the params and count is not tested thoroughly. so please tell me your testing results that i can fix problems. j. Hey, I'm struggling to get _adlibEnable working when sending multiple parameters. I've looked at the Call help section, and have got multiple params working with the Call function. The simple code below shows the Call function working, and the _adlibEnable not working. Any help greatly apprecitate... #include <ButtonConstants.au3> #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <_adlib.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 95, 200, 192, 124) $ButAdLib = GUICtrlCreateButton("_Adlib", 10, 20, 75, 25, $WS_GROUP) $ButCall = GUICtrlCreateButton("Call", 10, 120, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) dim $aParams[3] #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButAdLib $aParams[0] = "CallArgArray" $aParams[1] = 10 $aParams[2] = 2 _adlibEnable("timed", 1000, 3, $aParams) Case $ButCall $aParams[0] = "CallArgArray" $aParams[1] = 10 $aParams[2] = 2 Call("timed", $aParams) EndSwitch WEnd func timed($number1, $number2) MsgBox(1, "", $number1 & $number2) EndFunc Link to comment Share on other sites More sharing options...
joseLB Posted November 9, 2009 Share Posted November 9, 2009 Hi jenico Thanks for the script. It by sure will help me, as I normally make programs related to asyncronous events and from time to time must check if things are going well, and other stuff. Do you have a more recent version? Thanks Jose Link to comment Share on other sites More sharing options...
Bert Posted November 10, 2009 Share Posted November 10, 2009 @jennicoI'm going to chime in here so you can get a different perspective.The title of your thread: Multithreading for AutoIt - finally is what the experienced coders have issue with. Your title suggest AutoIt can do something it CAN NOT do. You have also said that in a different post. #601534Now, saying all that, you may want to change the title of your OP to something else than Multithreading for AutoIt - finally Otherwise you will keep getting badgered on making a false claim in the OP. This is just my opinion and in no way implies what you did wasn't a nice piece of work. It is a good piece of work. The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Splash Posted November 10, 2009 Share Posted November 10, 2009 Nice! Automatic Update UDF - IP Address UDF - WinPcap AutoIt _FindDevice()[font="Verdana"][size="2"]AutoIt Spanish/Brasil/World community!!![/size][/font]Use you wanna a dot.tk domain please use my link: Link to comment Share on other sites More sharing options...
mikered82 Posted March 13, 2010 Share Posted March 13, 2010 (edited) @RagsRevengeSearch in your "_Adlib.au3" for "If $al_param[$al_ID] Then" and replace it with "If $al_param[$al_ID] Or IsArray($al_param[$al_ID]) Then"By the way, good job jennico. Edited March 13, 2010 by mikered82 Link to comment Share on other sites More sharing options...
wchan2122 Posted March 15, 2010 Share Posted March 15, 2010 I encounter problem when I run the example. Please advise >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Autoit\Script\Muti-Task\Muti-T4.au3" C:\Program Files\AutoIt3\Include\_Adlib.au3 (137) : ==> Variable used without being declared.: If $al_ID > $al_func[0] Or $al_ID < 0 Then Return 0 If $al_ID > ^ ERROR >Exit code: 1 Time: 0.330 ;--Muti-T4.au3 #Include <_Adlib.au3> Func fone() for $n1 = 1 to 9000 GuiCtrlSetData($lab1,$n) sleep(500) next EndFunc Func ftwo() for $n2 = 1 to 9000 GuiCtrlSetData($lab2,$n) sleep(400) next EndFunc Link to comment Share on other sites More sharing options...
wchan2122 Posted March 18, 2010 Share Posted March 18, 2010 I run the other sample with below error message. Please advise how to fix it. >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\Autoit\Script\Muti-Task\Muti-T5.au3" C:\Program Files\AutoIt3\Include\_Adlib.au3 (225) : ==> Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.: If $al_current[$al_ID] Then $t = __Euclid($t, $al_time[$al_ID]) >Exit code: 1 Time: 0.638 Link to comment Share on other sites More sharing options...
gelman Posted June 6, 2011 Share Posted June 6, 2011 Hello, I'm using this example: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListBoxConstants.au3> #include <ProgressConstants.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> #Include <GuiListBox.au3> #Include <GuiEdit.au3> #Include "_Adlib.au3" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 427, 407, 193, 125) $List1 = GUICtrlCreateList("", 8, 8, 201, 214) $List2 = GUICtrlCreateList("", 216, 8, 193, 214) $Progress1 = GUICtrlCreateProgress(8, 232, 150, 17) $Slider1 = GUICtrlCreateSlider(8, 256, 150, 45) $Button1 = GUICtrlCreateButton("Button1", 8, 312, 75, 25, 0) $Button2 = GUICtrlCreateButton("Button2", 8, 352, 75, 25, 0) $Edit1 = GUICtrlCreateEdit("", 216, 232, 185, 97) $Label1 = GUICtrlCreateLabel("Label1", 112, 312, 80, 17) $Label2 = GUICtrlCreateLabel("Label2", 112, 352, 36, 17) $Button3 = GUICtrlCreateButton("Pause", 248, 360, 75, 25, 0) $Button4 = GUICtrlCreateButton("Resume", 328, 360, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $iCount = 0 _AdlibEnable("_1",1) _AdlibEnable("_2",1) _AdlibEnable("_3",1) _AdlibEnable("_4",400) _AdlibEnable("_5",500) _AdlibEnable("_6",6000) _AdlibEnable("_7",700) _AdlibEnable("_8",1) _AdlibEnable("_9",1000) _AdlibEnable("_0",2000) _AdlibActive() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 _AdlibPause(0) Case $Button4 _AdlibResume(0) EndSwitch WEnd Func _1() _GUICtrlListBox_AddString($List1, @SEC &"="& Random(0, 9) ) EndFunc Func _2() _GUICtrlListBox_AddString($List2, @SEC &"="& Random(9, 0) ) EndFunc Func _3() GUICtrlSetData($Progress1, Random(0, 100, 1)) EndFunc Func _4() GUICtrlSetData($Slider1, Random(0, 100, 1)) EndFunc Func _5() ControlMove("", "", $Button1, Random(0, 18), Random(300, 350)) EndFunc Func _6() ControlMove("", "", $Button2, Random(0, 24), Random(336, 352)) EndFunc Func _7() _GUICtrlEdit_AppendText($Edit1, "Hellow World, welcome to my world" &@CRLF) EndFunc Func _8() $iCount += 1 GUICtrlSetData($Label1, "count: " & $iCount) EndFunc Func _9() ToolTip("Hello", Random(@DesktopHeight, @DesktopWidth, 1)) EndFunc Func _0() ConsoleWrite("The cow barks like a fish" &@lf) EndFunc And I get this error: _Adlib.au3 (137) : ==> Variable used without being declared.: If $al_ID > $al_func[0] Or $al_ID < 0 Then Return 0 Any ideas how to fix it? Link to comment Share on other sites More sharing options...
jiglei Posted July 10, 2011 Share Posted July 10, 2011 Hello, I'm using this example: expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListBoxConstants.au3> #include <ProgressConstants.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> #Include <GuiListBox.au3> #Include <GuiEdit.au3> #Include "_Adlib.au3" #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 427, 407, 193, 125) $List1 = GUICtrlCreateList("", 8, 8, 201, 214) $List2 = GUICtrlCreateList("", 216, 8, 193, 214) $Progress1 = GUICtrlCreateProgress(8, 232, 150, 17) $Slider1 = GUICtrlCreateSlider(8, 256, 150, 45) $Button1 = GUICtrlCreateButton("Button1", 8, 312, 75, 25, 0) $Button2 = GUICtrlCreateButton("Button2", 8, 352, 75, 25, 0) $Edit1 = GUICtrlCreateEdit("", 216, 232, 185, 97) $Label1 = GUICtrlCreateLabel("Label1", 112, 312, 80, 17) $Label2 = GUICtrlCreateLabel("Label2", 112, 352, 36, 17) $Button3 = GUICtrlCreateButton("Pause", 248, 360, 75, 25, 0) $Button4 = GUICtrlCreateButton("Resume", 328, 360, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $iCount = 0 _AdlibEnable("_1",1) _AdlibEnable("_2",1) _AdlibEnable("_3",1) _AdlibEnable("_4",400) _AdlibEnable("_5",500) _AdlibEnable("_6",6000) _AdlibEnable("_7",700) _AdlibEnable("_8",1) _AdlibEnable("_9",1000) _AdlibEnable("_0",2000) _AdlibActive() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 _AdlibPause(0) Case $Button4 _AdlibResume(0) EndSwitch WEnd Func _1() _GUICtrlListBox_AddString($List1, @SEC &"="& Random(0, 9) ) EndFunc Func _2() _GUICtrlListBox_AddString($List2, @SEC &"="& Random(9, 0) ) EndFunc Func _3() GUICtrlSetData($Progress1, Random(0, 100, 1)) EndFunc Func _4() GUICtrlSetData($Slider1, Random(0, 100, 1)) EndFunc Func _5() ControlMove("", "", $Button1, Random(0, 18), Random(300, 350)) EndFunc Func _6() ControlMove("", "", $Button2, Random(0, 24), Random(336, 352)) EndFunc Func _7() _GUICtrlEdit_AppendText($Edit1, "Hellow World, welcome to my world" &@CRLF) EndFunc Func _8() $iCount += 1 GUICtrlSetData($Label1, "count: " & $iCount) EndFunc Func _9() ToolTip("Hello", Random(@DesktopHeight, @DesktopWidth, 1)) EndFunc Func _0() ConsoleWrite("The cow barks like a fish" &@lf) EndFunc And I get this error: _Adlib.au3 (137) : ==> Variable used without being declared.: If $al_ID > $al_func[0] Or $al_ID < 0 Then Return 0 Any ideas how to fix it? Why are you using this UDF when there's now a native function in autoit that does the same? AdlibRegister() and AdlibUnRegister(). Try those. Link to comment Share on other sites More sharing options...
dmob Posted July 11, 2011 Share Posted July 11, 2011 Why are you using this UDF when there's now a native function in autoit that does the same? AdlibRegister() and AdlibUnRegister().Try those.This one has additional features, like pausing & resuming adlibs, status info about adlibs, etc. I find itvery handy coz I have a number such adlibs running 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