Jump to content

Need help on binding multiple keys to one while script is running


Recommended Posts

Hello,

as stated in the title I need help with a pretty simple thing. I want to bind the sequence of "LCTRL", "SPACE" and "e" to a single key (for example "t") and be able to press t on demand to trigger the sequence. Now I've spent quite some time searching the forums and tutorials as well as help sites but I've never been really deep into programming so figuring out how to fix the mistakes I make is very hard for me.

 

I've taken one of Melba23's scripts which he posted on the forums 7 years ago to help another person out and modified it to my demand. If I start the script and press "t" I get "e" as a result but only once.

 

The script is as following:

HotKeySet("t", "???")
HotKeySet("{ESC}", "On_Exit")


While 1
    Sleep(10)
WEnd

Func ???()

    ; Unset the HotKey
    HotKeySet("t")
    ; Send the keys
    Send("{LCTRL}")
    Sleep(10)
    Send("{SPACE}")
    Sleep(10)
    Send("e")
    Sleep(10)
    ; Reset the HotKey
    HotKeySet("t", "{LCTRL}{SPACE}e")

EndFunc

Func On_Exit()
    Exit
EndFunc

 

I've put "???" where I had no clue what to put even after reading through several guides. My problem now is that I don't know if it actually performs left control, space and "e" once I press "t" or if it only performs e. Also I want this to happen as long as the script is running and not only once. I'm sure the reason it's only running once is very simple and for most people obvious but I can't come up with the perfect solution myself so I figured I'd ask for help.

 

thanks for your time and have a great day!

CaptainDank

 

Link to comment
Share on other sites

40 minutes ago, Subz said:

Hopefully this isn't for game automation?

<snip>

 

It actually is. How does that matter? It's not against that games rules to prevent your fingers from dying as long sa you have to press something.

I see that you've edited some things. Do you have any comments on that?

 

Thanks for your answer though

Edited by JLogan3o13
Link to comment
Share on other sites

  • Moderators
25 minutes ago, CaptainDank said:

How does that matter?

It matters because the forum rules clearly state that we will not support:

Quote
  • Launching, automation or script interaction with games or game servers, regardless of the game.

Not sure why people believe they are the exception to this rule.

 

@Subz here's a thought, if you suspect rule-breaking behavior in the future, ask before providing a suggestion. 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...