Hilfe bei der autoit while schleife

03/03/2010 16:11 Nico001#1
Hallo,
also ich habe ein problem und weiß nicht wie ich das lösen kann :(
ich will einen Multihack machen für metin2
aber wenn ich eine value freezen muss dann mache ich eine while schleife und dann kann man keinen anderen Button mehr aktivieren :(

z.B. (ein anderes von mit erstelltes programm)

Code:


Case $send1
While 1
Send("1")
WEnd
Case $send2
While 2
Send("2")
WEnd
Case $close
Exit


(das ist in einem gui)

und ich kann immernoch nur 1 button drücken der die ganze zeit eine taste drücken soll

pls hilfeee
kann jemand den code so umschreiben das man beide buttons drücken kann ???

thx schonmal
03/03/2010 16:12 FanTasY.#2
Frag deine Frage nächstes mal im AutoIt Unterforum oder im Frage und Antwort Thread.

Lg FanTasY.
03/04/2010 04:31 Nicklas1971#3
Du musst die $send als Funktionen machen, so wie du das machst kann es nicht gehen. Bitte mal das AutoIT Handbuch zur Hilfe nehmen.

Hier noch mal ein kleines Beispiel damit du da evtl weiter basteln kannst:

03/04/2010 04:32 XxxXHakanXxxX#4
vllt als admin ausführen
03/04/2010 12:28 iBobele#5
Wieso hast du 2 mal While drinnen?
03/04/2010 13:32 Nico001#6
einmal damit er an dauernt 1 drückt und einmal damit er andauernt 2 drückt

es funktioniert imma noch net
neuer code:
#include <ButtonConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("send 1", 265, 118, 193, 133)
$send1 = GUICtrlCreateButton("start", 16, 24, 75, 25, 0)
$test = GUICtrlCreateButton("test", 96, 24, 75, 25, 0)
$close = GUICtrlCreateButton("exit", 176, 24, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("test:", 16, 56, 28, 17)
$say = GUICtrlCreateInput("", 16, 80, 233, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $send1
_send1()
Case $test
_test()
Case $close
_close()
EndSwitch
WEnd


Func _send1()
While 1
Send("1")
WEnd
EndFunc

Func _test()
MsgBox(0,"test","Dieses Programm sendet jede 2 sec test und das 5 mal!")
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
MsgBox(0,"test","Test ist zu Ende!")
EndFunc


Func _close()
Exit
EndFunc
03/04/2010 23:11 MrCrackR#7
autoit führt immer nur eine funktion auf einmal aus.
wenn du was gleichzeitig machen willst, solltest du c++ lernen.

der code hier sollte dein problem ansatzweiße lösen:
Code:
#include <ButtonConstants.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("send 1", 265, 118, 193, 133)
$send1 = GUICtrlCreateButton("start", 16, 24, 75, 25, 0)
$test = GUICtrlCreateButton("test", 96, 24, 75, 25, 0)
$close = GUICtrlCreateButton("exit", 176, 24, 75, 25, 0)
$Label1 = GUICtrlCreateLabel("test:", 16, 56, 28, 17)
$say = GUICtrlCreateInput("", 16, 80, 233, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $send1
			_send1()
		Case $test
			_test()
		Case $close
			_close()
	EndSwitch
WEnd

Func _send1()
	While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		Case $send1
			_send1()
		Case $test
			_test()
		Case $close
			_close()
	EndSwitch
	Send("1")
	WEnd
EndFunc

Func _test()
MsgBox(0,"test","Dieses Programm sendet jede 2 sec test und das 5 mal!")
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
Sleep(2000)
Send("test")
MsgBox(0,"test","Test ist zu Ende!")
EndFunc


Func _close()
Exit
EndFunc
03/05/2010 13:10 Nico001#8
Jo danke nur leider hört er dann mit dem send 1 nicht auf aber da guck ich mal selber
bekommst n thx