Author Topic: One command for multiple keys  (Read 3435 times)

Mastengwe

  • Guest
One command for multiple keys
« on: May 04, 2019, 07:50:23 PM »
I’m playing a game where I’d like to use one key press to issue different commands. Basically it’s an MMO game and I’m running out of keybinds. So if I have a mouse button bound to “skill 1” then if I hit the same button, it issues “skill 2” then when hit again, “skill 3” then resets...

Can this be done?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: One command for multiple keys
« Reply #1 on: May 04, 2019, 10:59:04 PM »
You can use conditions and an integer value to do that, like this:
Code: [Select]
Set integer [>>{CMDWHENISAY}State] to [>>{CMDWHENISAY}State] plus 1
Begin Integer Compare : [>>{CMDWHENISAY}State] Equals 1
    Press Left Shift+1 keys and hold for 0,06 seconds and release
Else If Integer Compare : [>>{CMDWHENISAY}State] Equals 2
    Press Left Shift+2 keys and hold for 0,06 seconds and release
Else
    Press Left Shift+3 keys and hold for 0,06 seconds and release
    Set integer [>>{CMDWHENISAY}State] value to 0
End Condition

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #2 on: May 05, 2019, 03:38:41 AM »
I’m not quite understanding this. Though it seems like it’s what I’m talking about I think. Can you elaborate on the cmdwhenisay state?

I’m not going to be saying anything. I’ll be using a keyboard key. Does that change anything?

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #3 on: May 05, 2019, 03:50:55 AM »
I tried this and for some reason, it does nothing at all. 

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #4 on: May 05, 2019, 04:20:41 AM »
I’m not understanding the: “[>>{CMDWHENISAY}State] to [>>{CMDWHENISAY}State] plus 1” part. All I can get it to do is:

set integer [NAME] value to 1

And nothing I do seems to make it work.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: One command for multiple keys
« Reply #5 on: May 05, 2019, 03:30:07 PM »
"{CMDWHENISAY}" is a token that will be replaced with the contents of the "When I say" field of your command, I.E. the "name" of your command". This means you could copy these actions to any command and they wouldn't interfere with eachother.

You're looking to increment the value by 1, so you need to use the "Computed value" option of your "Set an Integer Value" action, set it to "Add", select "Compute against a value", set it to "1", and check "Evaluate Not Set as zero".

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #6 on: May 05, 2019, 10:42:33 PM »
I tried it. This doesn’t work for some reason. When I put all of this in, and then try it out- it just executes the first skill. It doesn’t do anything after that.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: One command for multiple keys
« Reply #7 on: May 06, 2019, 12:42:51 AM »
Can you show what you have in your command?

Right-click the action list, choose "Copy All as Text" in the context menu, paste it here in code tags(the "#" button).

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #8 on: May 06, 2019, 02:44:19 AM »
I don’t see an option to copy all.

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #9 on: May 06, 2019, 02:50:13 AM »
Went back and checked what you said earlier... it was the check “add” part I had wrong.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: One command for multiple keys
« Reply #10 on: May 06, 2019, 03:20:22 AM »
I assume it's working now then?


For future reference:

Mastengwe

  • Guest
Re: One command for multiple keys
« Reply #11 on: May 06, 2019, 04:02:06 AM »
Yeah it’s working. Seems that was the problem.