Core Twitch Commands

-- THE ACCOMPANYING AUTOHOTKEY SCRIPT: https://www.luasnippets.com/code-snippets/twitch-2-core-commands/

local commands = {}
commands[6] = {"!airdrop",6}
commands[7] = {"!ban",7}
commands[8] = {"!heal",8}
commands[9] = {"!kick",9}
commands[0] = {"!melee",0}
commands[66] = {"!nextmap",66}
commands[67] = {"!pay",67}
commands[68] = {"!troops",68}
commands[69] = {"!weather",69}

print(commands[6][1])


_G["twitchcommand"] = "" -- build string to call function

function _startTwitchCommand()
    _G["twitchcommand"] = "" -- clear the old !command
end

function _endTwitchComand() -- execute !command
    print("Run The !Command from Twitch: ".._G["twitchcommand"])    
    print(commands[tonumber(_G["twitchcommand"])][1])    
end

function _buildCommand(ss)
    _G["twitchcommand"] = _G["twitchcommand"]..ss
end

function OnBindingPressed(player, binding) -- keys are being pressed!

    -- KEYS TO USE For Twitch Commands: _+67890 F9 F10
    if(binding == "ability_extra_58")then -- F9
        _startTwitchCommand()
    end
    if(binding == "ability_extra_59")then -- F10
        _endTwitchComand()
    end
    if(binding == "ability_extra_6")then -- 6
        _buildCommand("6")
    end
    if(binding == "ability_extra_7")then -- 7
        _buildCommand("7")
    end
    if(binding == "ability_extra_8")then -- 8
        _buildCommand("8")
    end
    if(binding == "ability_extra_9")then -- 9
        _buildCommand("9")
    end
    if(binding == "ability_extra_0")then -- 0
        _buildCommand("0")
    end
    
    end

Game.playerJoinedEvent:Connect(function(player)
    player.bindingPressedEvent:Connect(OnBindingPressed)
end)

Latest Posts

Emulation ProcessEmulation Process

  Record Locs for Emulation in Core Grab data. Here, I am recording x,yz, and name data to emulate. Next Convert to usable array for Core template data. Snippet>> Pattern  Core template replacement pattern: Path:[C:\Users\soandso\Documents\My Games\CORE\Saved\Maps\mycoregame\Data\Tree\Emulator_