From ca0c894647e6a840dc987b1d19eb8fe1ef541644 Mon Sep 17 00:00:00 2001 From: ahao-laptop Date: Wed, 15 Feb 2023 17:45:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=94=A8ghub?= =?UTF-8?q?=E9=AB=98cpu=E5=8D=A0=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/APEX/ghub2scripts.json | 4 ++-- resource/General/ghub2scripts.json | 4 ++-- resource/PUBG/ghub2scripts.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resource/APEX/ghub2scripts.json b/resource/APEX/ghub2scripts.json index b5b414a..16f5a6c 100644 --- a/resource/APEX/ghub2scripts.json +++ b/resource/APEX/ghub2scripts.json @@ -30,7 +30,7 @@ false ], "script": [ - "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep3(1)\n end\nend", + "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep(1)\n end\nend", "", "", false @@ -41,4 +41,4 @@ "", false ] -} \ No newline at end of file +} diff --git a/resource/General/ghub2scripts.json b/resource/General/ghub2scripts.json index e087cb2..abd769f 100644 --- a/resource/General/ghub2scripts.json +++ b/resource/General/ghub2scripts.json @@ -30,7 +30,7 @@ false ], "script": [ - "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep3(1)\n end\nend", + "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep(1)\n end\nend", "", "", false @@ -41,4 +41,4 @@ "", false ] -} \ No newline at end of file +} diff --git a/resource/PUBG/ghub2scripts.json b/resource/PUBG/ghub2scripts.json index 917ca5d..12a1207 100644 --- a/resource/PUBG/ghub2scripts.json +++ b/resource/PUBG/ghub2scripts.json @@ -54,7 +54,7 @@ false ], "script": [ - "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep3(1)\n end\nend", + "EnablePrimaryMouseButtonEvents(true)\n\nconfig = {{}}\nvars = {{}}\n\ndofile(\"{}\")\nbindkeys(config, vars)\n\nfunction Sleep3(time)\n local a = GetRunningTime()\n while GetRunningTime() - a < time do\n end\nend\n\nClearLog()\nOutputLogMessage(\"Running\"..\"\\n\")\nfunction OnEvent(event, arg)\n -- \u83b7\u53d6\u9f20\u6807\u72b6\u6001\n mousebtns = {{}}\n for i = 1, 5, 1 do\n mousebtns[i] = {{}}\n mousebtns[i][1] = false\n for _, key in pairs(config[\"keys\"]) do\n buttonconfig = config[key]\n if i == buttonconfig[\"button\"] then\n mousebtns[i][2] = buttonconfig\n end\n end\n end\n\n while (true) do\n\n -- \u53ea\u652f\u6301G1-G5 \u548c\u5f53\u524d\u63d2\u5165\u7684\u7f57\u6280\u9f20\u6807\u597d\u50cf\u6ca1\u6709\u5173\u7cfb\n for i = 1, 5, 1 do\n iPressed = IsMouseButtonPressed(i)\n pressed = nil\n if mousebtns[i][1] ~= iPressed then\n -- \u6309\u952e\u72b6\u6001\u6539\u53d8\n if mousebtns[i][1] then\n -- true -> false \u8bf4\u660e\u6309\u952e\u91ca\u653e\n pressed = false\n else\n -- false -> true \u8bf4\u660e\u6309\u952e\u6309\u4e0b\n pressed = true\n end\n\n mousebtns[i][1] = iPressed \n if pressed == false then\n if mousebtns[i][2] ~= nil then\n local func = _G[mousebtns[i][2][\"funcRelease\"]]\n if func then\n func(vars)\n end\n end\n elseif pressed == true then\n if mousebtns[i][2] ~= nil then\n match = true\n for _, modifier in pairs(mousebtns[i][2][\"modifier\"]) do\n if not IsModifierPressed(modifier) then\n match = false\n end\n end\n if match then\n local func = _G[mousebtns[i][2][\"funcPress\"]]\n if func then\n func(vars)\n end\n end\n end\n end\n else\n -- \u6309\u952e\u72b6\u6001\u672a\u6539\u53d8\n if ads(vars) then\n dorecoil(vars)\n end\n end\n\n end\n\n -- \u4fee\u6539\u811a\u672c\u524d\u505c\u6b62\u5faa\u73af \u5426\u5219ghub\u5d29\u6e83\n if mousebtns[1][1] and mousebtns[2][1] then\n OutputLogMessage(\"Exited\\n\")\n return\n end\n\n Sleep(1)\n end\nend", "", "", false @@ -71,4 +71,4 @@ "180\u5ea6\u8f6c\u8eab", true ] -} \ No newline at end of file +}