Opt command (delay)

07/29/2011 15:32 shad0wboss#1
Can someone check why $key3 isn't working properly...
Quote:
While 1
$msg = GUIGetMsg()

Select

Case $msg = $startbutton

$send1 = GUICtrlRead($key1)
$send2 = Guictrlread($key2)

$sleep1 = GUICtrlRead($time1)
AdlibRegister("_Send", $sleep1)

Case $msg = $Startbuff
$send1 = GUICtrlRead($key3)
Opt(GUICtrlRead($key3),5000)


Case $msg = $stopbutton
Exit
Case $msg = $GUI_EVENT_CLOSE
GUIDelete()
ExitLoop


EndSelect
WEnd
07/29/2011 21:54 .AppleTree.#2
Hmmm i'm pretty sure that you can't use Opt with "GuiCtrlRead(...)"
can you please tell me wath you tried there

Sry for my Engl i'm from Swizerland ;)
07/29/2011 22:41 shad0wboss#3
Quote:
Originally Posted by Creeper-Man View Post
Hmmm i'm pretty sure that you can't use Opt with "GuiCtrlRead(...)"
can you please tell me wath you tried there

Sry for my Engl i'm from Swizerland ;)
haha i'm also from switzerland :P

anyways i tried to send $key3 after a delay of 5 seconds in a loop. But i want $key1 and $key2 to go every 0.5 seconds in a loop (unlimited)

Incase you speak French, J'ai essayé d'envoyer $key3 après un retard de 5 secondes dans une boucle. Mais je veux $key1 et $key2 d'aller toutes les 0,5 secondes dans une boucle (illimité)
07/30/2011 15:14 .AppleTree.#4
huh and wath's inside of "_Send" i think i need the full script i cant help you with this part if you dont want to upload it for everyone you can send me a private message
07/30/2011 15:46 lolkop#5
you should try something like this:
Code:
Dim $key[3][2] = [['a', 0.5],['b',0.5],['c',5]]
Dim $timer[UBound($key)]

While 1
	For $i=0 To UBound($key)-1
		If TimerDiff($timer[$i])>=$key[$i][1]*1000 Then
			Send($key[$i][0])
			$timer[$i] = TimerInit()
		EndIf
	Next
WEnd
07/30/2011 20:17 shad0wboss#6
Thanks a lot, i replaced "a" and "b" by the values i needed and it's working like a charm, thx a lot !