Trying to do two things in one script

Get help with using AutoHotkey and its commands and hotkeys
Arhelay
Posts: 1
Joined: 28 Mar 2019, 08:19

Trying to do two things in one script

28 Mar 2019, 08:38

Hello guys. I made simple script for game Warframe from scraps of various different scrips i found

Code: Select all

#NoEnv
#MaxThreadsPerHotkey 3
#IfWinActive Warframe
#Warn
~$lalt::
While GetKeyState("lalt", "P"){
    Send, {lctrl down}
    Sleep 10
    Send, e
    Send, {lctrl up}
    Sleep 290
}
    return

#NoEnv
#MaxThreadsPerHotkey 3
#IfWinActive Warframe
#Warn
+z::
toggle := !toggle
Loop {
    if (toggle) {
        send, 2
        Sleep, 100
    } else {
        break
    }
}
    return
The first part is to perform slide-attack in game when im holding LALT. It pressing CTRL then clicks E then releasing CTRL. It works alright.
But today i added second part, simple loop that click 2 when toggled with Shifr+Z, its doing this alright but also start looping Shift(sprint) and CTRL(crouch) keys when im holding them
ALso, do i need to pit stuff like #noEnv before each thread or only once at script start?
Also, how can i change script so it will always click 2. But when im holding LALT it will still loop 2 between button presses? Thing is script using 2 to put enemies to sleep, and slide attack to kill them afterward to get bonus XP. So its better to break sliding attack to cast sleep at enemies. If there's no woke enemes pressing 2 does nothing, and not breaking attack. So if i would be able to loop 2 AND do slide attack it would be superb
Thanks you

Return to “Ask For Help”

Who is online

Users browsing this forum: aifritz, AMA, boiler, fortunate, Google [Bot], King_Fisher, Odlanir, Pepineros, tank and 207 guests