using abilities in a game, running in the background Topic is solved

Ask gaming related questions (AHK v1.1 and older)
TrapWHre

using abilities in a game, running in the background  Topic is solved

22 Sep 2017, 13:14

Hello,

I have created a macro for an mmorpg that pulls mobs every xx seconds (presses 4, hotbar has the pull function on 4) with the logitech gaming software (doing a few other things aswell but putting that aside for now)
it runs without problems, the obvious problem is, that the game has to be the active window, otherwise it stops and interferes with other applications unless i stop it of course.

The past 2 days I have been searching EVERYWHERE about solutions, on how i can run a macro like this, with the game being inactive (on my second monitor, not minimized), with the macro only affecting the game and nothing else.

first i tried a virtual machine, hoping i could alt tab out of it and it would keep the macro running, but virtualbox won't even get the game running.

I had found blue-eyes-macro. however, the game being inactive, i didn't get my character to move with simple wasd macros at all. opening up the ingame chat, clicking outside the game (making it out of focus again), it'd type in the keystrokes wasd into the chat though..

then i tried AHK, but i simply cannot get it to work.
simple stuff like..

Code: Select all

LOOP{
Send {W down}
Sleep 1000
Send {W up}
Sleep 1000
Send {A down}
Sleep 1000
Send {A up}
Sleep 1000
Send {S down}
Sleep 1000
Send {S up}
Sleep 1000
Send {D down}
Sleep 1000
Send {D up}
Sleep 1000
}
..works, obviousy only with the game being active.

i tried ControlSend in all variations, but i had no success at all.
i'm tired and my head is about to blow up.
is anyone kind enough to code me a simple script to move my character 1000ms forward, and 1000ms backwards, which i can try out ?
i don't have a clue in terms of coding/scripting at all. it's like i am currently trying to teach myself chinese i swear, ugh.

Code: Select all

F2:: 
Loop{
ControlSend, , {w down}, ahk_class Valve001
Sleep 1000
ControlSend, , {w up}, ahk_class Valve001
Sleep 1000
ControlSend, , {s down}, ahk_class Valve001
Sleep 1000
ControlSend, , {s up}, ahk_class Valve001
}
.. is one of the few things i tried last.

Basic Window Info
Title: Counter-Strike: Source
Class: Valve001
User avatar
Reloaded
Posts: 283
Joined: 25 Aug 2017, 08:48

Re: using abilities in a game, running in the background

23 Sep 2017, 13:09

Better is this With F2 you start the Script and if you want stop it Push again F2 and its stop ^^

Code: Select all

#MaxThreadsperHotkey 2
f2::
toggle := !Toggle
loop
{
if toggle
{
Send, {W down}
Sleep, 1000
Send, {W up}
Sleep, 1000
Send, {A down}
Sleep, 1000
Send, {A up}
Sleep, 1000
Send, {S down}
Sleep, 1000
Send, {S up}
Sleep, 1000
Send, {D down}
Sleep, 1000
Send, {D up}
}

else
	break
}
return

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 54 guests