Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 03:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



multitreadh

Discussion on multitreadh within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
multitreadh

how i can make a multitreadh for a bot?? I know that autoit don't support multitreadh but i saw a lot of script that simulate multitreadh...

es. I've 8 function and one gui with start button and 8 checkbox. At button pressed if checkbox 1 is checked then run func 1, if checkbox 1 and checkbox 2 are checked then run func 1 and 2...if all checkbox are checked then run all func...
How i make it??
fuso98 is offline  
Old 09/09/2012, 12:59   #2
 
Achat's Avatar
 
elite*gold: 528
Join Date: Jan 2012
Posts: 2,127
Received Thanks: 2,403
Example:
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 32, 16, 81, 41)
$Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 24, 64, 105, 49)
$Checkbox3 = GUICtrlCreateCheckbox("Checkbox3", 24, 128, 129, 49)
$Checkbox4 = GUICtrlCreateCheckbox("Checkbox4", 8, 200, 153, 65)
$Checkbox5 = GUICtrlCreateCheckbox("Checkbox5", 24, 304, 113, 41)
$Checkbox6 = GUICtrlCreateCheckbox("Checkbox6", 208, 32, 97, 49)
$Checkbox7 = GUICtrlCreateCheckbox("Checkbox7", 216, 112, 129, 57)
$Checkbox8 = GUICtrlCreateCheckbox("Checkbox8", 200, 192, 105, 73)
$Button1 = GUICtrlCreateButton("Button1", 224, 336, 113, 81)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Button1
			If GUICtrlRead($Checkbox1) = 1 Then
				_Func1()
			EndIf
			If GUICtrlRead($Checkbox2) = 1 Then
				_Func2()
			EndIf
			;....

	EndSwitch
WEnd
€dit: For that you could use arrays and a for-loop.

Regards
Achat is offline  
Old 09/09/2012, 13:20   #3
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
ok but it run script in loop, i want that it run func simultaneously
fuso98 is offline  
Old 09/09/2012, 14:12   #4
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,149
Code:
Dim $Paused = True, $Checkbox[10]

GUICreate("", 100, (UBound($Checkbox) + 1) * 30)
For $i = 0 To UBound($Checkbox) - 1
	$Checkbox[$i] = GUICtrlCreateCheckbox("Checkbox " & $i, 5, 5 + $i * 30)
Next
$btn_Start = GUICtrlCreateButton("Start", 5, UBound($Checkbox) * 30, 90)
GUISetState()

While Sleep(10)
	Switch GUIGetMsg()
		Case -3
			Exit
		Case $btn_Start
			$Paused = Not $Paused
			If $Paused Then
				GUICtrlSetData($btn_Start, "Start")
			Else
				GUICtrlSetData($btn_Start, "Stop")
			EndIf
	EndSwitch

	If Not $Paused Then
		For $i = 0 To UBound($Checkbox) - 1
			If GUICtrlRead($Checkbox[$i]) == 1 Then Call("_Func" & $i)
		Next
	EndIf
WEnd

Func _Func0()
	;..
EndFunc

;...
KDeluxe is offline  
Old 09/10/2012, 15:07   #5


 
K1ramoX's Avatar
 
elite*gold: 26
Join Date: Jan 2012
Posts: 3,474
Received Thanks: 18,844
multithreading works in autoit with asm functions ;o
K1ramoX is offline  
Old 09/10/2012, 16:00   #6
 
fuso98's Avatar
 
elite*gold: 428
Join Date: Dec 2011
Posts: 2,722
Received Thanks: 2,035
what are asm function ?? sorry my n00b question
fuso98 is offline  
Reply




All times are GMT +1. The time now is 03:32.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.