Thanks for replying. I have tried for an hour trying to test it out in various ways but it doesn't seem to work. I'm placing the code in this manner just like you stated:
----------------------------------------------------
#SingleInstance, Force
#Persistent
#NoEnv
^1::WinGet, active_id, PID, A
Loop
^j::
{
ControlSend, , {x}, ahk_pid %active_id%
Sleep 180
}
return
#IfWinActive, MapleStory
SendMode Input
#InstallKeybdHook
-::
Suspend
Pause,,1
return
-------------------------------------------
The "SendMode Input
#InstallKeybdHook" is meant for keystrokes to be recognized in the game. Without this, MapleStory won't detect the keystrokes like the button 'x' and it doesn't work.
-::
Suspend
Pause,,1
return
As for the one above, that is just the function of pressing the "-" button in order to pause the spamming of the "x" button whenever you want or to play it again. Honestly, with my previous script, it works but just only works on the ChatBox with it spamming xxxxxx even when I am browsing internet, but when I have it spam the attack xxxxx, it works until the moment I switch to another 'Windows'. This is really a pain to deal with.
-------------------------------------------------------------------
You know, just having you trying to help out means a lot to me. If possible there's two other things that is bothering me, I have spent roughly 3 hours just to make it work but it still doesn't due to my lack of know-how in scripting.
The first one is: With the script I have set, the x button is spammed continuously. But I want it to pause at every 45th second in order to press {LCtrl} (Left Control) button Once before the x button is played again. Right now, I have set the Left Control button with a delay, but because of that delay, the x button is also delayed for 45 second and doesn't spam. So what I want is to have the 45 sec delay only on the Left Control Button while the x button is to pause when the Left Control Button is about to press, meaning I want the x button to be pressed most of the time.
The second one is: I want the script to work while having it press the Down Arrow button and the D button together (in order to teleport to different platforms) [Only press it once]. I want it for that button to be pressed every 1 min and 30 second, and is remained on the new platform for 15 second before you press the Up Arrow and the D button together. Now that you are back up in the original platform, the 1min and 30 second will count down and will be teleported down again and the cycle continues like that along with the x button spamming and the {LCtrl} every 45 second if possible. Because the problem right now is that, I have the Down and D button work and it teleported, but the Down button was spammed continuously and wouldn't be left up.
I did something like:
ControlSend, , {Down Down}d
Sleep, 100
ControlSend, , [Down Up}
Sleep, 15000
Again, any help is much appreciated!