Help to improve this

Ask gaming related questions (AHK v1.1 and older)
grandson
Posts: 13
Joined: 11 Oct 2020, 14:16

Help to improve this

Post by grandson » 22 Jan 2021, 02:44

Guys, I need help to perfect and humanize this script:

----------------------------------------

Code: Select all

~RButton::
while GetKeyState("RButton", "P")
send {d}
sleep 75
return

NumpadEnter::
  Suspend
  Pause ,,1
  if A_IsPaused {
    ToolTip, PAUSED, 200, 250
  } else {
    ToolTip, RUNNING, 200, 250
    SetTimer RemoveToolTip, 1000
  }
return


RemoveToolTip:
  ToolTip
  SetTimer, RemoveToolTip, Off
return
----------------------------------------

The basic conception of the script is to press the "D" key while I am pressing the right mouse button.

However, I need to add a time interval and a certain amount of random times that the "D" should be pressed.

I need that when I am pressing the right mouse button the "D" is pressed twice, before it is pressed twice more, have a short wait time so as not to get something like this:
"ddddddddddddddddddddddd ..."

it would look something like this:
dd (sleep 50) d (sleep 50) ddd (sleep 50) dd (sleep 50) d (sleep 50) ddd (sleep 50) ...

The important thing is that I just need to keep the right mouse button pressed, if I release it, it goes back to the beginning of the command

Can someone help me please!!!
Last edited by BoBo on 22 Jan 2021, 02:59, edited 1 time in total.
Reason: Moved to Gaming section.
grandson
Posts: 13
Joined: 11 Oct 2020, 14:16

Re: Help to improve this

Post by grandson » 22 Jan 2021, 03:32

someone? please
Rohwedder
Posts: 7630
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Help to improve this

Post by Rohwedder » 22 Jan 2021, 03:33

Hallo,
perhaps:

Code: Select all

~RButton::
while GetKeyState("RButton", "P")
{
	Random, Rand, 0, 3 ;0 - 3 Keypresses
	send {d %Rand%}
	Random, Rand, 50, 300 ;50 - 300 ms
	Sleep, Rand
}
return
grandson
Posts: 13
Joined: 11 Oct 2020, 14:16

Re: Help to improve this

Post by grandson » 22 Jan 2021, 03:42

Rohwedder wrote:
22 Jan 2021, 03:33
Hallo,
perhaps:

Code: Select all

~RButton::
while GetKeyState("RButton", "P")
{
	Random, Rand, 0, 3 ;0 - 3 Keypresses
	send {d %Rand%}
	Random, Rand, 50, 300 ;50 - 300 ms
	Sleep, Rand
}
return
i will test, thanks very much !!!
Post Reply

Return to “Gaming Help (v1)”