I want to loop pressing w and s infinitely (each press can last about a couple of milliseconds) with a small-time between each press but I need it to happen whilst my other loops are happening, so basically it should be independent of the entire script, or having that action happen in a completely different script but I need it to activate with a hotkey if possible ctrl+alt+z.
This is the script, I know its long but it does exactly what I need to do.
--------------------------------------------------------------------------------------------------------------------
Code: Select all
Menu, Tray, NoIcon
#SingleInstance, force
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Gui, Add, Edit, x42 y109 w120 h20 vPressTimeAD gActivation,
Gui, Add, Edit, x42 y139 w120 h20 vPressTimeW gActivation,
Gui, Add, Edit, x42 y169 w120 h20 vDestroyButton gActivation,
Gui, Color, black
Gui, Font, S8 CWhite, Verdana
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S20 CWhite, Asinastra
Gui, Add, Text, x48 y19 w350 h30 +Center, Pigeon's netherwart script
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x562 y-1 w-30 h170 , GroupBox
Gui, Font, S16 CWhite, Asinastra
Gui, Add, GroupBox, x28 y69 w390 h150 , Config
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x192 y139 w190 h30 , W press time
Gui, Add, Text, x192 y169 w210 h30 , Attack/destroy button
Gui, Add, Text, x192 y109 w190 h30 , AD press time
Gui, Font, S18 CWhite, Asinastra
Gui, Add, GroupBox, x28 y239 w390 h170 , Info
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S20 CDefault, Asinastra
Gui, Font, S16 CDefault, Asinastra
Gui, Font, S14 CDefault, Asinastra
Gui, Font, S18 CBlack, Asinastra
Gui, Font, S12 CWhite, Asinastra
Gui, Add, Text, x322 y429 w120 h30 , 1000-7 im ghoul
Gui, Font, S16 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Font, S14 CWhite, Asinastra
Gui, Add, Text, x42 y309 w360 h30 , Script from discord.gg/S2tYVMNxNM
Gui, Add, Text, x42 y349 w330 h30 , ctrl+alt+q - script activation
Gui, Add, Text, x42 y269 w190 h30 , F9 - exit
Gui, Add, Text, x232 y269 w170 h30 , F10 - reload
; Generated using SmartGUI Creator 4.0
Gui, Show, x304 y107 h488 w451, New GUI Window
Return
Activation:
Gui, Submit, NoHide
!^q::
#Persistent
SetTimer, Infinite, 50
Return
Infinite:
ControlSend,, ws, ahk_exe javaw.exe
Return
Loop
{
;main part
ControlSend,, {%DestroyButton% down}, ahk_exe javaw.exe
Loop, 3
{
sleep 100
ControlSend,, {d down}, ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down} , ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {a up}, ahk_exe javaw.exe
Loop, 12
{
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down} , ahk_exe javaw.exe
sleep 100
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down}, ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down} , ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
}
}
Loop, 3
{
sleep 100
ControlSend,, {a down} , ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down} , ahk_exe javaw.exe
sleep 100
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down}, ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
Loop, 12
{
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {a down} , ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {a up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down} , ahk_exe javaw.exe
sleep 100
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {w down}, ahk_exe javaw.exe
sleep 400
ControlSend,, {w up}, ahk_exe javaw.exe
sleep 100
ControlSend,, {d down}, ahk_exe javaw.exe
sleep %PressTimeAD%
ControlSend,, {d up}, ahk_exe javaw.exe
sleep 100
}
}
}
F9::ExitApp
F10::Reload
GuiClose:
GuiEscape:
ExitApp
return
------------------------------------------------------------------------------------------------------------