Hawe done some changes
This is what i loock like
betveen the 2 / / is a text box whid the name off the box
---------------------------------------------------------
Start F11
Stop F10
Skill Slott Time (mS)
Passive Skill 1 / PS1C /
Passive Skill 2 / PS2C /
Aktive Skill 1 / AS1C / / AS1T /
Aktive Skill 2 / AS2C / / AS2T /
Times to repet / repete /
---------------------------------------------------------
The PS1C and PS2C is going to start after i hawe pressed the F11 key and 0,5 sek after the prog hawe pressed the 'u' key
example: PS1C = 1 and PS2C = 2 the prog will press the 1 key then wait fore 0,5 sek then presses the 2 key.
The AS1C and AS2C is the same but the AS1T and AS2T sets a time
example AS1C is 3 and AS2C is 4 the AS1T is 5000 and AS2T is 3000
The prog presses the 3 key waits fore 5 sek then press 4 waits 3 sek then press 3 agen.
After 30st 3 presses and 30 4 presses the prog presses the 'p' key waits fore 10 sek then begins to press 3 and 4 agen fore 30 times.
that if i hawe inputet 30 in the "Times to repet" txt box.
think that is all.
this is waht i hawe done. (hawent got it to wurk att all)
After a ' it is a coment on what i want the line to do.
Dim lop As Integer
Dim PS1 As Integer
Dim PS2 As Integer
Dim AS1 As Integer
Dim AS2 As Integer
Dim AS1a As Integer
Dim AS2a As Integer
Dim SendKeys As String
Dim repetetimes As Integer
Private Sub Form_Load()
Me.KeyPreview = True
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Debug.Print KeyCode, Shift
Select Case KeyCode
Case vbKeyF11
lop = 1
PS1 = PS1C.Text
PS2 = PS2C.Text
AS1 = AS1C.Text
AS2 = AS2C.Text
AS1a = AS1T.Text
AS2a = AS2T.Text
repetetimes = repet.Text
object.SendKeys "u" ' press the u key
object.sleep 500 ' wait for 0,5 sek
If PS1C <> "Input" Then 'If the txt box PS1C is not empty then contineu
' SendKeys 1 'press the button that is assigned to PS1C ex 1
object.sleep 500 ' wait for 0,5 sek
End If
If PS2C <> "Input" Then 'If the txt box PS2C is not empty then contineu
object.SendKeys PS2 'press the button that is assigned to PS2C ex 2
object.sleep 500 ' wait 0,5 sek
End If
'Do Until Case vbKeyF10 'stop running the prog when press the F10 button
start:
Do While lop < repetetimes 'run this part the times specified in the "Times to repet" txt box
If AS1C <> "Input" Then
object.SendKeys AS1 'press the button that is assigned to PS1C ex 3
object.sleep = AS1a 'wait for the number in mS assigned in AS1T ex 5000 (5 sek)
End If
If AS2C <> "Input" Then
object.SendKeys AS2 'press the button that is assigned to PS1C ex 4
object.sleep = AS2a 'wait for the number in mS assigned in AS1T ex 3000 (3 sek)
End If
lop = lop + 1
Loop
object.SendKeys "p" ' press the p key
object.sleep 10000 'wait 10 sek
lop = 1 ' resett the lop
Case vbKeyF10 = DoEvents
GoTo start
'Loop
End Sub
I want to be able to press the F11 key in eny prog to start the prosess.
This is wahat it loocks like