LeftClick rapidfire with modifier and a last LeftClick on key release?! Topic is solved

Ask gaming related questions (AHK v1.1 and older)
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

LeftClick rapidfire with modifier and a last LeftClick on key release?!

08 Jan 2018, 05:49

I have a short question:
How can I produce a "rapidfire" hotkey when holding CTRL + Left Click?!
When I release one of both, the rapidfire have to stop AND do one last Left Click.

Code: Select all

#IfWinActive Diablo III ahk_class D3 Main Window Class
CapsLock::Ctrl
Ctrl::Alt

<!$LButton::
Loop {
  Click, L
  sleep 25
  If (!GetKeyState("LButton","p"))
    break
}
Return
#IfWinActive
That's what I tried so far.
It's working. BUT only if I hold Ctrl FIRST and LeftClick after... :-\
I want to perform it when both keys are holding down, not in a special order.

So for example:
When I hold down LeftClick to move in Diablo 3, and I press Ctrl it have to spam LeftClicks.
When I release the Ctrl key again, it have to press ONE time LeftClick again (because I still hold LeftClick) to move!
When I press Ctrl first, LeftClick after it have to spam LeftClicks aswell. The order shouldn't matter. Just spam LeftClicks when BOTH keys are holding down.
When release Ctrl +1 last LeftClick to still move around.
If you have Diablo 3 you can test it your own.
This is pretty nice to loot all the items on the ground. LeftClick hold = walk around. CTRL + LeftClick = spam LeftClicks to mouse over the items on the ground to loot them! :-)
My script above works well. But only in correct order. AND if I release Ctrl I have to release LeftClick and press (and hold) it again to move :-\


I hope you understand and can help somehow.
Thanks a lot for reading!
Last edited by homezonebenny on 11 Jan 2018, 16:47, edited 1 time in total.
QuantumD0T
Posts: 7
Joined: 07 Jan 2018, 18:39

Re: LeftClick rapidfire with modifier and a last LeftClick on key release?!

08 Jan 2018, 13:02

I have more questions than answers :P

Your script is exactly what I want (initially with f8 but Ctr works actually best)

problem is that you turn the Ctr into Alt, so all the fucntions like Ctr+c, Ctr+v are lost while script is running....

so I modified it a bit, but when I use the <^LButton the script doesn't actually send the CTR and when I try to implement it the script stops working....

sry for hijacking but my previous attempt (thread next to this one) is a total disaster....

what I ended up with:

Code: Select all

<^LButton::
send, {LCtrl down}  ;THIS BREAKS IT
Loop {	
	send, {lbutton down}
	RandSleep(45,60) ;sleep a random length of time
	send, {lbutton up}
	RandSleep(40,60) ;sleep a random length of time
  If (!GetKeyState("LButton","p"))
	send, {LCtrl up}  ;THIS BREAKS IT
	break
}
Return

RandSleep(x,y) {
Random, rand, %x%, %y%
Sleep %rand%
}
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Re: LeftClick rapidfire with modifier and a last LeftClick on key release?!

08 Jan 2018, 18:54

Deleted because solved and not necessary.
Last edited by homezonebenny on 11 Jan 2018, 16:53, edited 2 times in total.
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Re: LeftClick rapidfire with modifier and a last LeftClick on key release?!

08 Jan 2018, 19:52

Deleted because solved and not necessary.
Last edited by homezonebenny on 11 Jan 2018, 16:46, edited 1 time in total.
QuantumD0T
Posts: 7
Joined: 07 Jan 2018, 18:39

Re: LeftClick rapidfire with modifier and a last LeftClick on key release?!

08 Jan 2018, 23:20

hmmm so let me get it right.... to loot in d3 you have to hold ctr and than click? then if you want to move you just LMB click?

because the problem I keep having with the script is when using it the spam happens on CTR+LMB but the CTR itself doesn't get passed on... so the output is just LMB spam.... what I need is CTR being held down and then spam LMB...

btw, I see alot of these scripts use a set sleep time.... isnt that asking to get detected by script or bot checks? I'm lil paranoid myself so anytime I automate anything i implement rng into the delays
homezonebenny
Posts: 20
Joined: 23 Apr 2016, 08:36

Re: LeftClick rapidfire with modifier and a last LeftClick on key release?!  Topic is solved

09 Jan 2018, 01:24

My last script (after EDIT) do exactly what you want!
Just copy paste it.

Go into Diablo 3 Hotkey Menu.
Change 1 2 3 4 to:
Q W E R
"Force standing still" on SHIFT
"Force movement" on SPACE

Now you can use 1 2 3 4 5 6 and so on for:
Quest Menu, Paragon, Archivements and so on. However you like it.

With my Script you just can hold down left click "to move" like you do it all day long.
When you HOLD now CapsLock you spam click click click for "autoloot". If you release CapsLock you stop spaming.
If you release LeftClick you stand still.
IF you hit CapsLock just 1 time without any LeftClick. You "automove" all day long. Without any LeftClick holding needed, pretty cool heh?! :-D

Code: Select all

;;------------------------------------------------------------------
; Diablo 3 Makros
;------------------------------------------------------------------

#IfWinActive Diablo III ahk_class D3 Main Window Class

CapsLock::Alt
$CapsLock::
  Loop {
    Click, L
    sleep 25
    If (!GetKeyState("CapsLock","p"))
      break
  }
  Click, {LButton Down}
  Return
$LButton::
  Click, {LButton Down}
  return
$LButton Up::
  Click, {LButton Up}
  return


$^RButton::
  Loop {
    Click, R
    sleep 25
    If (!GetKeyState("RButton","p"))
      break
  }
  return


$RButton::
  Loop {
    Click, R
    sleep 100
    If (!GetKeyState("RButton","p"))
      break
  }
  return

#IfWinActive

When you want to buy ULTRA FAST on Kadala, just hold CTRL and Right Click on the item you want to spam buy!
If you play Necromancer class, and you eat the corps, just hold right click now.
You don't need to click click click for every new spawned dead body... This makes it much more fun to play the Necromancer class!

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 40 guests