AndroidOL AndroidOL
关注数: 5 粉丝数: 44 发帖数: 1,449 关注贴吧数: 7
Logitech Gaming Software Lua 脚本模拟按键,输出字符串 function putChar(makeString) if (makeString == "") then else for loop = 1, #makeString do tempString = string.sub(makeString, loop, loop) if (tempString == " ") then PressAndReleaseKey("spacebar") elseif (tempString == "`") then PressAndReleaseKey("tilde") elseif (tempString == "-") then PressAndReleaseKey("minus") elseif (tempString == "=") then PressAndReleaseKey("equal") elseif (tempString == "\b") then PressAndReleaseKey("backspace") elseif (tempString == "\t") then PressAndReleaseKey("tab") elseif (tempString == "[") then PressAndReleaseKey("lbracket") elseif (tempString == "]") then PressAndReleaseKey("rbracket") elseif (tempString == "\\") then PressAndReleaseKey("backslash") elseif (tempString == ";") then PressAndReleaseKey("semicolon") elseif (tempString == "*") then PressAndReleaseKey("quote") elseif (tempString == "\n") then PressAndReleaseKey("enter") elseif (tempString == ",") then PressAndReleaseKey("comma") elseif (tempString == ".") then PressAndReleaseKey("period") elseif (tempString == "/") then PressAndReleaseKey("slash") elseif (tempString == ":") then PressKey("lshift") PressKey("semicolon") ReleaseKey("semicolon") ReleaseKey("lshift") elseif (tempString == "!") then PressKey("lshift") PressKey("1") ReleaseKey("1") ReleaseKey("lshift") elseif (tempString == "@") then PressKey("lshift") PressKey("2") ReleaseKey("2") ReleaseKey("lshift") elseif (tempString == "#") then PressKey("lshift") PressKey("3") ReleaseKey("3") ReleaseKey("lshift") elseif (tempString == "$") then PressKey("lshift") PressKey("4") ReleaseKey("4") ReleaseKey("lshift") elseif (tempString == "%") then PressKey("lshift") PressKey("5") ReleaseKey("5") ReleaseKey("lshift") elseif (tempString == "^") then PressKey("lshift") PressKey("6") ReleaseKey("6") ReleaseKey("lshift") elseif (tempString == "&") then PressKey("lshift") PressKey("7") ReleaseKey("7") ReleaseKey("lshift") elseif (tempString == "*") then PressKey("lshift") PressKey("8") ReleaseKey("8") ReleaseKey("lshift") elseif (tempString == "(") then PressKey("lshift") PressKey("9") ReleaseKey("9") ReleaseKey("lshift") elseif (tempString == ")") then PressKey("lshift") PressKey("0") ReleaseKey("0") ReleaseKey("lshift") elseif (tempString == "_") then PressKey("lshift") PressKey("minus") ReleaseKey("minus") ReleaseKey("lshift") elseif (tempString == "+") then PressKey("lshift") PressKey("equal") ReleaseKey("equal") ReleaseKey("lshift") elseif (tempString == "{") then PressKey("lshift") PressKey("lbracket") ReleaseKey("lbracket") ReleaseKey("lshift") elseif (tempString == "}") then PressKey("lshift") PressKey("rbracket") ReleaseKey("rbracket") ReleaseKey("lshift") elseif (tempString == "|") then PressKey("lshift") PressKey("backslash") ReleaseKey("backslash") ReleaseKey("lshift") elseif (tempString == "\"") then PressKey("lshift") PressKey("quote") ReleaseKey("quote") ReleaseKey("lshift") elseif (tempString == "<") then PressKey("lshift") PressKey("comma") ReleaseKey("comma") ReleaseKey("lshift") elseif (tempString == ">") then PressKey("lshift") PressKey("period") ReleaseKey("period") ReleaseKey("lshift") elseif (tempString == "?") then PressKey("lshift") PressKey("slash") ReleaseKey("slash") ReleaseKey("lshift") else PressAndReleaseKey(tempString) end end end end function OnEvent(event, arg) if (event == "G_PRESSED") then tempChar = GetDate() putChar(tempChar) end end
罗技 RGB 渐变求测试,求壕围观,求大神改进,求各种 function OnEvent(event, arg) if (event == "G_PRESSED" and arg == 1) then colorList = {} table.insert(colorList, { Name = "#FF1B1B", Red = 255, Green = 27, Blue = 27 }) table.insert(colorList, { Name = "#FF761B", Red = 255, Green = 118, Blue = 27 }) table.insert(colorList, { Name = "#FFA41B", Red = 255, Green = 164, Blue = 27 }) table.insert(colorList, { Name = "#FFD21B", Red = 255, Green = 210, Blue = 27 }) table.insert(colorList, { Name = "#FEFF1B", Red = 254, Green = 255, Blue = 27 }) table.insert(colorList, { Name = "#B1E819", Red = 177, Green = 232, Blue = 25 }) table.insert(colorList, { Name = "#17D21B", Red = 23, Green = 210, Blue = 27 }) table.insert(colorList, { Name = "#17A2D2", Red = 23, Green = 162, Blue = 210 }) table.insert(colorList, { Name = "#1763D2", Red = 23, Green = 99, Blue = 210 }) table.insert(colorList, { Name = "#3817D2", Red = 56, Green = 23, Blue = 210 }) table.insert(colorList, { Name = "#9717D2", Red = 151, Green = 23, Blue = 210 }) table.insert(colorList, { Name = "#DE1888", Red = 222, Green = 24, Blue = 136 }) colorTemp = { ["Red"] = 255, ["Green"] = 255, ["Blue"] = 255 } SetBacklightColor(255, 255, 255) while true do for loop = 1, #colorList do OutputLogMessage("Color-No." .. loop .. ":\t" .. colorList[loop].Name .. "\n") r = colorTemp.Red g = colorTemp.Green b = colorTemp.Blue rIV = (colorList[loop].Red - r) / 50 - ((colorList[loop].Red - r) / 50) % 0.01 gIV = (colorList[loop].Green - g) / 50 - ((colorList[loop].Green - g) / 50) % 0.01 bIV = (colorList[loop].Blue - b) / 50 - ((colorList[loop].Blue - b) / 50) % 0.01 OutputLogMessage("rIV.Red: " .. rIV .. ",\tgIV: " .. gIV .. ",\tbIV: " .. bIV .. "\n") for loopColor = 1, 50 do colorTemp.Red = colorTemp.Red + rIV colorTemp.Green = colorTemp.Green + gIV colorTemp.Blue = colorTemp.Blue + bIV SetBacklightColor(colorTemp.Red, colorTemp.Green, colorTemp.Blue) --OutputLogMessage("colorTemp.Red: " .. colorTemp.Red .. ",\tcolorTemp.Green: " .. colorTemp.Green .. ",\tcolorTemp.Blue: " .. colorTemp.Blue .. "\n") Sleep(50) --if (event == "G_PRESSED" and arg == 6) then --break --end end colorTemp.Red = math.ceil(colorTemp.Red) colorTemp.Green = math.ceil(colorTemp.Green) colorTemp.Blue = math.ceil(colorTemp.Blue) --OutputLogMessage("Loop: " .. loop .. ". Target. To. R: " .. colorTemp.Red .. "/G: " .. colorTemp.Green .. "/B: " .. colorTemp.Blue .. "\n") --OutputLogMessage("Loop: " .. loop .. ". Target. To. R: " .. colorList[loop].Red .. "/G: " .. colorList[loop].Green .. "/B: " .. colorList[loop].Blue .. "\n\n") colorTemp.Red = colorList[loop].Red colorTemp.Green = colorList[loop].Green colorTemp.Blue = colorList[loop].Blue SetBacklightColor(colorTemp.Red, colorTemp.Green, colorTemp.Blue) end end end end 说明:
1 下一页