Script question!
Script question!
how can i make a script that when i press right ctrl it start pressing f1,f2,f3,f4,f5,f6,f7,f8 endlessly until i press right ctrl again?
Re: Script question!
Give this a try.
Code: Select all
#SingleInstance,Force
#MaxThreadsPerHotkey,10
SetKeyDelay,30,30
return
*Esc::ExitApp
*ctrl::
Tog:=!Tog
While(Tog){
While(Tog&&A_Index<=8){
Send,{F%A_Index%}
Sleep,100
}
}
return
Last edited by Hellbent on 10 Jan 2020, 14:47, edited 1 time in total.
Re: Script question!
Try this:
Code: Select all
#SingleInstance, Force
#Persistent
KeyToggle := 0
KeyIndex := 1
~RCtrl::
KeyToggle := !KeyToggle
SetTimer, Timer1, % (KeyToggle ? "1000" : "Off")
KeyIndex := (!KeyToggle ? 1 : KeyIndex)
return
Timer1:
Send, % "{F" KeyIndex "}"
KeyIndex++
If (KeyIndex > 8) {
KeyIndex := 1
}
return
Re: Script question!
i'll try it out thx!
Re: Script question!
well i try them both. None of them work for me, am i missing smth or is smth wrong with the script?
Re: Script question!
I paste it in a text file that i make it a .ahk file. Then i open the compiler browse the script, make the .exe file, open the the .exe file and press right ctrl and nothing happent. Can someone help me?
Re: Script question!
Modified from @Hellbent's code
Code: Select all
; This is required, otherwise the loop cannot be stopped.
#MaxThreadsPerHotkey 2
RCtrl::
toggle := !toggle
while toggle {
while (A_Index <= 8) {
if not Toggle
break
send {F%A_Index%}
sleep 1000 ;send delay
}
}
return
Who is online
Users browsing this forum: ht55cd3 and 262 guests