While 1
$timed1 = TimerDiff($timer1)
If $timed1 > $Time1 Then
ControlSend("Insanity FlyFF", "", "", "{F1}")
$timer1 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton2
$timer2 = TimerInit()
$Time2 = GUICtrlRead($Time2)
While 1
$timed2 = TimerDiff($timer2)
If $timed2 > $Time2 Then
ControlSend("Insanity FlyFF", "", "", "{F2}")
$timer2 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton3
$timer3 = TimerInit()
$Time3 = GUICtrlRead($Time3)
While 1
$timed3 = TimerDiff($timer3)
If $timed3 > $Time3 Then
ControlSend("Insanity FlyFF", "", "", "{F3}")
$timer3 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton4
$timer4 = TimerInit()
$Time4 = GUICtrlRead($Time4)
While 1
$timed4 = TimerDiff($timer4)
If $timed4 > $Time4 Then
ControlSend("Insanity FlyFF", "", "", "{F4}")
$timer4 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton5
$timer5 = TimerInit()
$Time5 = GUICtrlRead($Time5)
While 1
$timed5 = TimerDiff($timer5)
If $timed5 > $Time5 Then
ControlSend("Insanity FlyFF", "", "", "{F5}")
$timer5 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton6
$timer6 = TimerInit()
$Time6 = GUICtrlRead($Time6)
While 1
$timed6 = TimerDiff($timer6)
If $timed6 > $Time6 Then
ControlSend("Insanity FlyFF", "", "", "{F6}")
$timer6 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton7
$timer7 = TimerInit()
$Time7 = GUICtrlRead($Time7)
While 1
$timed7 = TimerDiff($timer7)
If $timed7 > $Time7 Then
ControlSend("Insanity FlyFF", "", "", "{F7}")
$timer7 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton8
$timer8 = TimerInit()
$Time8 = GUICtrlRead($Time8)
While 1
$timed8 = TimerDiff($timer8)
If $timed8 > $Time8 Then
ControlSend("Insanity FlyFF", "", "", "{F8}")
$timer8 = TimerInit()
EndIf
WEnd
Case $msg = $startbutton9
$timer9 = TimerInit()
$Time9 = GUICtrlRead($Time9)
While 1
$timed9 = TimerDiff($timer9)
If $timed9 > $Time9 Then
ControlSend("Insanity FlyFF", "", "", "{F9}")
$timer9 = TimerInit()
EndIf
WEnd
Case $msg = $GUI_EVENT_CLOSE
GUIDelete()
ExitLoop
EndSelect
WEnd
Now i dont know why, (probably because i dont have much knowledge of coding in autoit or any other langue/program for that matter) But for some reason only my first option (F1) works and then ONLY IF MY MOUSE IS HEAVILY ACTIVE...
As you all can hear from what i have said... i need help.
I am hoping someone can EXPLAIN (NOT give me the code) what i am doing wrong, and if this is even possible with AutoIt. (read something about multi threading not being possible with AutoIt... Should i go over to VB for this?)
u have too many loops..
if its possible (it should be) use only 1 infinite loop.
can you handel with arrays?
my english isnt verry well, so i try to explain with some comments
(this script was made by a epvp member (i think it was lolkop), just modified it)
PHP Code:
Dim $task[9][3], $keys[9] = ["{F1}","{F2}","{F3}","{F4}","{F5}","{F6}","{F7}","{F8}","{F9}"] ;$task[x][0] = x * timer() ;$task[x][1] = x * checkbox() ;$task[x][2] = x * inputbox() ;$keys[x] = your keys
$gui = GUICreate('', 120, 20*UBound($task)+10, Default, Default, 0x10C80000, 8) For $i=0 To UBound($task)-1 $task[$i][1]=GUICtrlCreateCheckbox('F'&$i+1, 10, 5+$i*20, 35, 20) $task[$i][2]=GUICtrlCreateInput(1000, 55, 5+$i*20, 50, 20, 1) Next ;^gui create relative to x
While GUIGetMsg()<>-3 ;-3 = $GUI_EVENT_CLOSE For $i=0 To UBound($task)-1 If BitAND(GUICtrlRead($task[$i][1]),1) And TimerDiff($task[$i][0])>=GUICtrlRead($task[$i][2]) Then ControlSend("Insanity FlyFF", "", "", $keys[$i]) $task[$i][0]=TimerInit() ;check for your 1st $checkbox (array [0]), if its checked ;and the 1st $timer is bigger then the 1st inputbox ;it sends the 1st $key ;reset the $timer ;now the 2nd... (1-9) EndIf Next WEnd
Case $MSG = $GUI_EVENT_CLOSE
GUIDelete()
EndSelect
WEnd
So i have fiddled around some myself, and reworked my script. The script above DID work with my GUI only just not without me keeping my mouse active (wut?), but it only works if you enter an interval for ALL 9 options... entering 0 doesnt work, neither does "".
Also for some reason ExitLoop does not work and without exiting the loop i cant close the program properly.
Some help on what i am doing wrong would me much appreciated, i know this what i made has to work, i probably am missing something...
While 1
[...]
<outer-loop actions>
While 1
[...]
<inner-loop actions>
WEnd
<outer-loop actions>
[...]
WEnd
to make you understand this a bit better, i've quoted your code, and simplyfied it a bit.
the problem with your script is, that u're using an never ending inner-loop. you should allready know, that scripting languages are executing your code line by line...
Code:
1: While <expression>
2: <action1>
3: WEnd
4: <action2>
this basicly means, if you use a static value like "1" as expression, expression can never be False, and there's no way out of that loop.
now if you use something like:
Code:
While <expression1>
While <expression2>
<action1>
Wend
<action2>
WEnd
with <expression1> = <expression2> = True, it will keep on performing <action1> but never reach <action2>
to get around this, you could simply put both actions into one loop like this:
Code:
While <expression1>
If <expression2> Then
<action1>
EndIf
<action2>
WEnd
This code will keep the function of the outer loop alive, while the innerloop will be executed within the outerloop, without killing the functionality of the outerloop.