FAQ  •  Register  •  Login

Setting a persistent global variable with mapped keys

Moderator: MiRai

<<

LargeChicken

User avatar

League of Extraordinary Multiboxers

Posts: 100

Joined: Mon Oct 01, 2012 2:33 pm

Post Sun Oct 05, 2014 11:46 pm

Setting a persistent global variable with mapped keys

I'd like to define a variable within a step in a mapped key which can be read and compared within another mapped key later. Is this possible?

Quick example of what I'm trying to accomplish with this:

Key 1:
--Step 1:
---Set Repeater Target to 'all other'
---Enable Keyboard / Mouse Repeating
---Set 'Variable1' to 1

--Step 2:
---Disable Keyboard / Mouse Repeating
---Set 'Variable1' to 0

Key 2:
--Step 1:
---Set Repeater Target to {SLOT1}
---Enable Keyboard/Mouse Repeating

--Step 2:
---Set repeater Target to 'All Other'
---If 'Variable1' Equals 1
--- -> Enable Keyboard / Mouse Repeating
---Else
--- -> Disable Keyboard / Mouse Repeating

Basically I want to use this to temporarily control Slot 1 and after I'm done doing that return to my original repeater state whether it was on or off.

Thanks.

EDIT: I've found a dirty solution to this by just activating Key 1 twice in the second step of Key 2 (Which in essence resets my repeater back where it was before activating Key 2) but that's not very clean and I'm wondering if there's a better way to do it.
I want YOU! To ask me questions
Tell me what you want a tutorial on in my request thread Here

My games:
Eve Online

Expertise:
Mining
Shooting red crosses
IsBoxer Setup
VideoFX
<<

bob

User avatar

League of Extraordinary Multiboxers

Posts: 4653

Joined: Sat Feb 15, 2014 11:14 am

Location: In the dining room, with the lead pipe.

Post Mon Oct 06, 2014 2:55 am

Re: Setting a persistent global variable with mapped keys

Well, you can use the Mapped Key Step State Action. It's not quite an If statement and things can get tricky with complex logic, but it works okay in your case.


Key 1:
--Step 1:
---Set Repeater Target to 'all other'
---Enable Keyboard / Mouse Repeating
---Set Keymap 2 Step 3 disabled
---Set Keymap 2 Step 2 enabled

--Step 2:
---Disable Keyboard / Mouse Repeating
---Set Keymap 2 Step 2 disabled
---Set Keymap 2 Step 3 enabled


Key 2:
--Step 1:
---Set Repeater Target to {SLOT1}
---Enable Keyboard/Mouse Repeating

--Step 2:
---Set repeater Target to 'All Other'
--- -> Enable Keyboard / Mouse Repeating

--Step 3:
---Set repeater Target to 'All Other'
--- -> Disable Keyboard / Mouse Repeating
<<

LargeChicken

User avatar

League of Extraordinary Multiboxers

Posts: 100

Joined: Mon Oct 01, 2012 2:33 pm

Post Mon Oct 06, 2014 1:16 pm

Re: Setting a persistent global variable with mapped keys

jonesy wrote:Well, you can use the Mapped Key Step State Action. It's not quite an If statement and things can get tricky with complex logic, but it works okay in your case.


Key 1:
--Step 1:
---Set Repeater Target to 'all other'
---Enable Keyboard / Mouse Repeating
---Set Keymap 2 Step 3 disabled
---Set Keymap 2 Step 2 enabled

--Step 2:
---Disable Keyboard / Mouse Repeating
---Set Keymap 2 Step 2 disabled
---Set Keymap 2 Step 3 enabled


Key 2:
--Step 1:
---Set Repeater Target to {SLOT1}
---Enable Keyboard/Mouse Repeating

--Step 2:
---Set repeater Target to 'All Other'
--- -> Enable Keyboard / Mouse Repeating

--Step 3:
---Set repeater Target to 'All Other'
--- -> Disable Keyboard / Mouse Repeating


Exactly what I was looking for, why didn't I think of that. Thanks.
I want YOU! To ask me questions
Tell me what you want a tutorial on in my request thread Here

My games:
Eve Online

Expertise:
Mining
Shooting red crosses
IsBoxer Setup
VideoFX

Return to Key Maps

Who is online

Users browsing this forum: No registered users and 0 guests