How to install
Well yer m8 it goes in
garrysmod/lua/autorun/client/keyrecorder.lua make sure to add the code aswell
How to use
lua_openscript_cl autorun/client/keyrecorder.lua
Then type
SuchIsGood_RecordKeys_Enable - To record keys Enable / Disable in the function!
SuchIsGood_PlayKeysBack - Play the keys back you pressed Enable / Disable in the function!
SuchIsGood_UnBindFuck - UnPresses the keys if they mess up!
This is currently version 0.1 expect bugs, Updates in the future, Via pastebin!
Code:
print("Auto key recoder loaded, Coded by SuchIsGood!")
local SuchIsGood = {}
SuchIsGood.RecordKeys = {}
SuchIsGood.RecordKeys.BindUse = {"-forward","-back","-moveright","-moveleft","-duck","-jump"}
SuchIsGood.RecordKeys.BindUsed = {"+forward","+back","+moveright","+moveleft","+duck","+jump"}
SuchIsGood.RecKey_Bool = false
SuchIsGood.PlayKey_Bool = false
local i = 0
local Play_Rec_Int = 0
hook.Add("PlayerBindPress", "PBP", function(p,k,b)
if SuchIsGood.RecKey_Bool == false then return end
if table.HasValue(SuchIsGood.RecordKeys.BindUsed, k) then
i = i + 1
print("Recorded Bind: "..k)
local mbk = string.gsub(k,"+","-")
SuchIsGood.RecordKeys[i] = {People = p, PlusKey = k, MinusKey = mbk, Bind = b}
end
end)
concommand.Add("SuchIsGood_RecordKeys_Enable", function(p,c,a)
if SuchIsGood.RecKey_Bool == false then
SuchIsGood.RecKey_Bool = true
print("Recording Keys!")
elseif SuchIsGood.RecKey_Bool == true then
SuchIsGood.RecKey_Bool = false
print("Stopped Recording Keys!")
end
end)
concommand.Add("SuchIsGood_PlayKeysBack", function(p,c,a)
if SuchIsGood.PlayKey_Bool == false then
SuchIsGood.PlayKey_Bool = true
print("Playing Back!")
elseif SuchIsGood.PlayKey_Bool == true then
SuchIsGood.PlayKey_Bool = false
print("Stopped Playing Back!")
end
end)
concommand.Add("SuchIsGood_UnBindFuck", function(p,c,a)
for _,unfuckery in pairs(SuchIsGood.RecordKeys.BindUse) do
LocalPlayer():ConCommand(tostring(unfuckery))
end
end)
timer.Create("SuchIsGood.PlayKey_Bool", 1, 0, function()
if SuchIsGood.PlayKey_Bool == false or i == 0 then return end
Play_Rec_Int = Play_Rec_Int + 1
print("Playing Key "..SuchIsGood.RecordKeys[Play_Rec_Int].PlusKey)
LocalPlayer():ConCommand(SuchIsGood.RecordKeys[Play_Rec_Int].PlusKey)
timer.Simple(0.2, function() LocalPlayer():ConCommand(SuchIsGood.RecordKeys[Play_Rec_Int].MinusKey) end)
if i == Play_Rec_Int then
print("Unbind Fucking Keys")
RunConsoleCommand("SuchIsGood_UnBindFuck")
end
end)
Code:
https://pastebin.com/B7r8581X