Ok hope u Guys can help me and understand waht i wanna do.
Basicly i want an Script that is holding the button a for 1sec, then let go this key and hold the button d instead for 1sec. And repeat this over and over again.
Im really new to AHK and it would be amazing if u Guys have any tips for me.
Script for switch holding a and d
-
- Posts: 2
- Joined: 13 Oct 2017, 03:34
Re: Script for switch holding a and d
Let's see:
Activate / Deactivate it with "ctrl + q".
Just to fill my curiosity... Are you here for The Evil Within 2?
Code: Select all
#MaxThreadsPerHotkey 2
*^q::
toggle := !Toggle
loop
{
If toggle
{
Send {a down}
sleep, 1000
Send {a up}
Send {d down}
sleep, 1000
Send {d up}
}
else
break
}
return
Just to fill my curiosity... Are you here for The Evil Within 2?
Re: Script for switch holding a and d
Hey! id post this Toggle Script xDelModo7 wrote:Let's see:Activate / Deactivate it with "ctrl + q".Code: Select all
#MaxThreadsPerHotkey 2 *^q:: toggle := !Toggle loop { If toggle { Send {a down} sleep, 1000 Send {a up} Send {d down} sleep, 1000 Send {d up} } else break } return
Just to fill my curiosity... Are you here for The Evil Within 2?
Re: Script for switch holding a and d
You did also reply to an older post I did and, as you can see there, I gave credit.Reloaded wrote:Hey! id post this Toggle Script xDelModo7 wrote:Let's see:Activate / Deactivate it with "ctrl + q".Code: Select all
#MaxThreadsPerHotkey 2 *^q:: toggle := !Toggle loop { If toggle { Send {a down} sleep, 1000 Send {a up} Send {d down} sleep, 1000 Send {d up} } else break } return
Just to fill my curiosity... Are you here for The Evil Within 2?
I normally tend to give credit.
However, in this case I remember writing the inner loop code myself, so if you did write it too, that may have just been pure coincidence. (Pressing a button each second is not something that varies a lot from method to method), it's like if someone asks how to add 1+1, the code section of reply messages will always be 1+1 or x+x or around that xD
Btw, that toggle script has existed almost since the language was born, it's like no need to credit a loop or a default function right?
That or I didn't understand what you meant
I can't see how you wrote that code, it's basic ahk scripting.
Re: Script for switch holding a and d
Here ;) Sry bad english im from Kasachstan but can speak German too :/elModo7 wrote:You did also reply to an older post I did and, as you can see there, I gave credit.Reloaded wrote:Hey! id post this Toggle Script xDelModo7 wrote:Let's see:Activate / Deactivate it with "ctrl + q".Code: Select all
#MaxThreadsPerHotkey 2 *^q:: toggle := !Toggle loop { If toggle { Send {a down} sleep, 1000 Send {a up} Send {d down} sleep, 1000 Send {d up} } else break } return
Just to fill my curiosity... Are you here for The Evil Within 2?
I normally tend to give credit.
However, in this case I remember writing the inner loop code myself, so if you did write it too, that may have just been pure coincidence. (Pressing a button each second is not something that varies a lot from method to method), it's like if someone asks how to add 1+1, the code section of reply messages will always be 1+1 or x+x or around that xD
Btw, that toggle script has existed almost since the language was born, it's like no need to credit a loop or a default function right?
That or I didn't understand what you meant :lol:
I can't see how you wrote that code, it's basic ahk scripting.
Copy and Paste the Full script into a new ahk file and make the Editor to Full screen, its better so ! trust me .
Code: Select all
#MaxThreadsPerHotkey 2 ;This you need for it send just 2 Keys (So work a Toggle Script better)
SetBatchLines -1 ;This make your Script faster
*^q:: ;With this Key you Start the Script
toggle := !Toggle ; "!" are mean False so its just start if you press the Key when you pressed it the "!" false going to be a "True" this means the Script can start.
loop ;Loop means the Script never end
{
If toggle ;The Toggle := !Toggle is now false if you press "*^q" the Flase go to an True and the Script can start
{
Send {a down} ;Here you Copy and Paste what you want to Send, click or something better said, your Script
sleep, 1000
Send {a up}
Send {d down}
sleep, 1000
Send {d up}
}
else ; This mean if you press again "*^q" he break the Loop, this mean the Loop stopoed
break
}
return ;The Script start at first line and go to the last, if they didnt stand "Return" the Script just close and think its over, but with return he go back to first line
Re: Script for switch holding a and d
I´m so Stupid xDelModo7 wrote:You did also reply to an older post I did and, as you can see there, I gave credit.Reloaded wrote:Hey! id post this Toggle Script xDelModo7 wrote:Let's see:Activate / Deactivate it with "ctrl + q".Code: Select all
#MaxThreadsPerHotkey 2 *^q:: toggle := !Toggle loop { If toggle { Send {a down} sleep, 1000 Send {a up} Send {d down} sleep, 1000 Send {d up} } else break } return
Just to fill my curiosity... Are you here for The Evil Within 2?
I normally tend to give credit.
However, in this case I remember writing the inner loop code myself, so if you did write it too, that may have just been pure coincidence. (Pressing a button each second is not something that varies a lot from method to method), it's like if someone asks how to add 1+1, the code section of reply messages will always be 1+1 or x+x or around that xD
Btw, that toggle script has existed almost since the language was born, it's like no need to credit a loop or a default function right?
That or I didn't understand what you meant
I can't see how you wrote that code, it's basic ahk scripting.
I understand it so you dont know how the Script xD
Jeah, can be some one else posted this Toggle Script, but im always at Gaming Forum and many ask me for Help because there Toggle Script didnt work, because this id said "Hey id posted the Script xD"
Re: Script for switch holding a and d
Nah I'm just saying I got a toggle code and then rewrited it to fit OP needs.
I mean that code was gotten from the ahk docs, you don't seem to understand that.
If I get code from someone else, the first thing I do is give credit.
You either don't understand English or idk what did you understand .
It's ok you are helpful, just don't take me wrong okey?
Have a good day btw
I mean that code was gotten from the ahk docs, you don't seem to understand that.
If I get code from someone else, the first thing I do is give credit.
You either don't understand English or idk what did you understand .
It's ok you are helpful, just don't take me wrong okey?
Have a good day btw
Who is online
Users browsing this forum: No registered users and 68 guests