ketlyn
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Hi,
I might be able to help you but need more info,
for Autohotkey script to work you need either autohotkey installed on your computer or
you need a compiled script to work, as a beginner you should know this,
and how you are pressing the "F" key press and hold / pressing simultaneously
and you have any script? if yes sharing it will help you a lot.
I might be able to help you but need more info,
for Autohotkey script to work you need either autohotkey installed on your computer or
you need a compiled script to work, as a beginner you should know this,
and how you are pressing the "F" key press and hold / pressing simultaneously
and you have any script? if yes sharing it will help you a lot.
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
...
Last edited by Swagger100 on 08 Feb 2020, 17:19, edited 1 time in total.
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Hi,
sleep is in milliseconds (1 second = 1000 millisecods)
adding 1ms won't help much, try adding 50ms, 100ms , and so on as per your requirement.
sleep is in milliseconds (1 second = 1000 millisecods)
adding 1ms won't help much, try adding 50ms, 100ms , and so on as per your requirement.
-
- Posts: 17
- Joined: 18 Dec 2019, 03:39
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Ahoy! ![Smile :)](./images/smilies/icon_e_smile.gif)
This should work for you:
If you need any help - feel free to ask!
![Smile :)](./images/smilies/icon_e_smile.gif)
This should work for you:
Code: Select all
#NoEnv
#Persistent
#SingleInstance, force
SendMode Input
SetBatchLines, -1
global IsRunning := false
global Keys := ["3", "4"]
global KeyCounter := 1
global TimeFromKeyToKey := 100 ; you can adjust this time to your liking
Loop {
if(IsRunning) {
PressKey(Keys[KeyCounter])
KeyCounter++
if(KeyCounter > 2) {
KeyCounter := 1
}
}
Sleep, %TimeFromKeyToKey%
}
PressKey(key) {
SendInput, {%key% down}
Sleep, 25
SendInput, {%key% up}
}
$F::
IsRunning := !IsRunning
return
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
....
Last edited by Swagger100 on 08 Feb 2020, 17:20, edited 1 time in total.
-
- Posts: 17
- Joined: 18 Dec 2019, 03:39
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Alright, this should do the trick -- just modify the value of SleepTime variable to your liking:
P.S. If you need to change the order of keys, just change this line:
to this:
Code: Select all
#NoEnv
#Persistent
#SingleInstance, force
SendMode Input
SetBatchLines, -1
global IsRunning := false
global Keys := ["3", "4"]
global SleepTime := 1000 ; you can adjust this time to your liking
Loop {
if(IsRunning) {
for key, value in Keys {
PressKey(value)
}
}
Sleep, %SleepTime%
}
PressKey(key) {
SendInput, {%key% down}
Sleep, 25
SendInput, {%key% up}
}
$F::
IsRunning := !IsRunning
return
Code: Select all
global Keys := ["3", "4"]
Code: Select all
global Keys := ["4", "3"]
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
-
- Posts: 17
- Joined: 18 Dec 2019, 03:39
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Alright, a different solution then perhaps:
Code: Select all
#NoEnv
#Persistent
#SingleInstance, force
SendMode Input
SetBatchLines, -1
global IsRunning := false
global Keys := ["3", "4"]
global SleepTime := 400 ; you can adjust this time to your liking
PressKey(key) {
SendInput, {%key% down}
Sleep, 25
SendInput, {%key% up}
}
$F::
IsRunning := !IsRunning
if(IsRunning) {
Gosub, PressKeys
SetTimer, PressKeys, %SleepTime%
}
else {
SetTimer, PressKeys, Off
}
return
PressKeys:
for key, value in Keys {
PressKey(value)
}
return
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Avast is well-known to detect false-positives for AHK scripts.
Obviously, the script (text) files above are relatively harmless. They are sending some keys (according to your request) which probably trigger some heuristic rule of Avast.
(Why these scripts are using global is not clear to me, but that's not the point.)
If you downloaded AHK (especially the interpreter) from our website and are reasonably sure that your system is clean, you could surely whitelist AHK in Avast - and report these scripts as false-positives to Avast. (But of course, you are solely responsible for executing any scripts on your computer.)
Obviously, the script (text) files above are relatively harmless. They are sending some keys (according to your request) which probably trigger some heuristic rule of Avast.
(Why these scripts are using global is not clear to me, but that's not the point.)
If you downloaded AHK (especially the interpreter) from our website and are reasonably sure that your system is clean, you could surely whitelist AHK in Avast - and report these scripts as false-positives to Avast. (But of course, you are solely responsible for executing any scripts on your computer.)
Re: Good night my name is Ketlyn, some of you can help me, I'm a beginner
Try this one:
NOTE: change the name of the process (In this case "notepad++.exe"), so the script only works inside the game you want, and doesn't mess around outside.
The sleep commands give some pause for the keys to not be too harsh, and allow other key input. Hope it suits you.
Cheers.
Code: Select all
;##############################################
#Persistent
SetTimer, checkit, 100
return
;##############################################
;##############################################
checkit()
{
if(testWindow())
{
GetKeyState, xstate, f
if (xstate = "D")
{
SendInput {3}
sleep 100
SendInput {4}
sleep 100
}
}
}
;##############################################
;--------------------------------------------------------------------
;check if active window is correct - this function avoids running scripts when the game window is not active.
;--------------------------------------------------------------------
testWindow()
{
windowId:="notepad++.exe" ;id of the game window
;get the window process name
WinGet, activeWindowId, ProcessName, A
if(activeWindowId = windowId)
{
;the process name is the same. The active window is the Game's window!
return true
}
else
{
;the process name is different. The game window is not active!
return false
}
return
}
;--------------------------------------------------------------------
;##############################################
The sleep commands give some pause for the keys to not be too harsh, and allow other key input. Hope it suits you.
Cheers.
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
- Swagger100
- Posts: 37
- Joined: 01 Dec 2019, 23:41
sss
vvv
Who is online
Users browsing this forum: Bing [Bot], bobstoner289, peter_ahk, Spawnova and 351 guests