From ea3168a11254f8f60c57e3b442372c949553a47e Mon Sep 17 00:00:00 2001 From: Aestolia Date: Thu, 25 Aug 2022 21:07:16 -0400 Subject: [PATCH] New plugin for Hotkey Swapping This plug in is to allow a Hotkey to swap to the next game in the shuffler - This is selected via a dropdown to a list of key combinations using Insert. This will allow various bots and such to call on a swap for things like Twitch channel point redeems. --- plugins/Hotkey-Swap.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/Hotkey-Swap.lua diff --git a/plugins/Hotkey-Swap.lua b/plugins/Hotkey-Swap.lua new file mode 100644 index 0000000..5ebb167 --- /dev/null +++ b/plugins/Hotkey-Swap.lua @@ -0,0 +1,31 @@ +local plugin = {} + +plugin.name = "Hotkey Game Swap" +plugin.author = "Aestolia & SaggingRufus" +plugin.settings = { + +{name='pressget', type='select', label="Hotkey for Swap", options={"Ctrl+Alt+Insert", "Ctrl+Shift+Insert", "Ctrl+Alt+Shift+Insert", "Alt+Shift+Insert"}}, + +} + +plugin.description = +[[ +Uses select hotkey combination to force a the game to change to the next one. + +code was canibalized from the authorblues Shuffler.lua +]] + +function plugin.on_frame(data, settings) + +local press = settings.pressget + + -- calculate input "rises" by subtracting the previously held inputs from the inputs on this frame + local input_rise = input.get() + for k,v in pairs(prev_input) do input_rise[k] = nil end + prev_input = input.get() + + -- mark the game as complete if the hotkey is pressed (and some time buffer) + if input_rise[press] then swap_game() + end +end +return plugin \ No newline at end of file