And here's the code:
Code: Select all
Lbutton::
settitlematchmode,2
IfWinActive, Chrome
click
sleep,0.000000000000000000000000001
click
Code: Select all
Lbutton::
settitlematchmode,2
IfWinActive, Chrome
click
sleep,0.000000000000000000000000001
click
Code: Select all
r::
on := !on
SoundBeep, 1000 + 500 * on
Return
#If mouseOver("chrome") && on
LButton::
Click
Sleep, 0
Click
SoundBeep, 1500
Return
#If
mouseOver(proc) {
MouseGetPos,,, uid
WinGet, thisProc, ProcessName, ahk_id %uid%
Return thisProc = proc ".exe"
}
Will this also turn it off if I press r again?mikeyww wrote: ↑29 Aug 2021, 09:15Code: Select all
r:: on := !on SoundBeep, 1000 + 500 * on Return #If mouseOver("chrome") && on LButton:: Click Sleep, 0 Click SoundBeep, 1500 Return #If mouseOver(proc) { MouseGetPos,,, uid WinGet, thisProc, ProcessName, ahk_id %uid% Return thisProc = proc ".exe" }
Can I remove the soundbeep things? @mikeywwmikeyww wrote: ↑29 Aug 2021, 09:15Code: Select all
r:: on := !on SoundBeep, 1000 + 500 * on Return #If mouseOver("chrome") && on LButton:: Click Sleep, 0 Click SoundBeep, 1500 Return #If mouseOver(proc) { MouseGetPos,,, uid WinGet, thisProc, ProcessName, ahk_id %uid% Return thisProc = proc ".exe" }
Code: Select all
#IfWinActive ahk_exe chrome.exe
r::
on := !on
SoundBeep, 1000 + 500 * on ; OK to remove this line
Return
#If mouseOver("chrome") && on
LButton::
Click
Sleep, 0
Click
Return
#If
mouseOver(proc) {
MouseGetPos,,, uid
WinGet, thisProc, ProcessName, ahk_id %uid%
Return thisProc = proc ".exe"
}
Ok so lemme tell you I want this script to do this: if I click my right click mouse button it sends 1 more right click mouse button press packet to my computer which takes it as 1 click = 2cps can you set it to title match mode and if any application haves the words *Lunar* in its a apps title, so it will make it like it will only work on lunar client/minecraft, thats all I want I hope you can now help with it.mikeyww wrote: ↑30 Aug 2021, 06:01If you have a different question than the one that you posted, then you will get a different answer. Nonetheless, if this script did not work for you in Chrome, then I do not have the answer. Sorry. The script works at my end. Others might be able to solve the issue for you.
You have not provided any description of what the entire script should do. I think that this will help other readers.
Code: Select all
SetTitleMatchMode, 2
#IfWinActive Lunar
RButton::
Click, R
Sleep, 500
Click, R
SoundBeep, 1000 ; OK to delete
Return
#IfWinActive
Whats the key to toggle it?mikeyww wrote: ↑30 Aug 2021, 06:57It seems that your initial post has nothing to do with your question. The script below worked when I tested it.
Code: Select all
SetTitleMatchMode, 2 #IfWinActive Lunar RButton:: Click, R Sleep, 500 Click, R SoundBeep, 1000 ; OK to delete Return #IfWinActive
I meant like if I could stop it for like 5secsmikeyww wrote: ↑30 Aug 2021, 09:30The trigger is the right mouse button. AHK denotes this button as RButton.
What the script does: "if I click my right click mouse button it sends 1 more right click mouse button press packet to my computer which takes it as 1 click = 2cps ... and if any application haves the words *Lunar* in its a apps title"
If you click on commands in the posted script, you can see more details about the commands, to learn how they work.
Hey, I've made a code can you test this? I don't have access to my pc rn so I can't test it the code:mikeyww wrote: ↑30 Aug 2021, 06:57It seems that your initial post has nothing to do with your question. The script below worked when I tested it.
Code: Select all
SetTitleMatchMode, 2 #IfWinActive Lunar RButton:: Click, R Sleep, 500 Click, R SoundBeep, 1000 ; OK to delete Return #IfWinActive
Code: Select all
Rbutton::
settitlematchmode,2
IfWinActive, Lunar
{
click, R
sleep,0.000000000000000000000000001
click, R
sleep,0.000000000000000000000000001
click, R
}
r::
Pause, Toggle
return
^b:: ExitApp
yea I only want this in lunar clientmikeyww wrote: ↑31 Aug 2021, 04:42Nor do I, but give it a go. Others may like to know if this works. The pause seems like it should be effective. Multi-line hotkey routines generally end in Return. I prefer my approach with the directive, but you have your choice of whatever works. One difference is that you have disabled your button in other programs.