养生 装修 购物 美食 感冒 便秘 营销 加盟 小吃 火锅 管理 创业 搭配 减肥 培训 旅游

g502鼠标宏设置压枪

时间:2024-10-10 18:23:56

罗技G502是一款非常经典的游戏鼠标,那么玩游戏的时候需要用到宏如何设置呢?怎么设置一个高性能的压枪宏呢?

工具/原料

罗技G502游戏鼠标

罗技游戏软件(驱动)

方法/步骤

1、罗技官网下载安装“罗技游戏软件”。

2、打开“罗技游戏软件”找到罗技游戏软件里对应的G502游戏鼠标,将配置文件设置为“自动游戏检测”

g502鼠标宏设置压枪

g502鼠标宏设置压枪

3、进入按键配置,选择配置文件,弹出菜单,选择“编写脚本”,进行脚本编写设置。

g502鼠标宏设置压枪

g502鼠标宏设置压枪

4、然后就可以编写脚本以配置按键和游戏设置以及宏了,脚本可以参考下面的自行编写,或藤舔趾贶者去下载一个配置文件修改。下面附上网络上流行的一套“绝地求生”游戏的配置设置脚本

g502鼠标宏设置压枪

5、localpubg=辘腋粪梯{}-------------------------------------------------------------幻腾寂埒--------------------快捷键定义区域-------------------------------------------------------------------------------pubg.keyPickupWeapon=8pubg.keyAlwayRun=4--直接按键pubg.keyLookAround=1--alt+G+定义pubg.keyWeaponUmp9=8--G+定义pubg.keyWeaponAkm=7--G+定义pubg.keyWeaponM16a4=7--定义pubg.keyWeaponM416=5--定义pubg.keyDrop=1--G+定义---------------------------------------------------------------------------------变量定义区域---------------------------------------------------------------------------------鼠标G键是否被按下pubg.isGKeyPressed=false--当鼠标G键被按下去之后,其他按钮是否被按下pubg.isOKeyPressed=false--当前选择的武器pubg.currentWeapon="NIL"---------------------------------------------------------------------------------随机函数,支出负数-------------------------------------------------------------------------------pubg.random=function(min,max) localnMin=1 localnMax=max-min localrandomNumber=math.random(nMin,nMax) returnrandomNumber+min-1end---------------------------------------------------------------------------------一件拾取装备=游戏中:从左边拉物品到武器栏中-------------------------------------------------------------------------------pubg.onPickupWeapon=function() localcurrentMouseX,currentMouseY=GetMousePosition() PressMouseButton(1) fori=1,5do MoveMouseRelative(pubg.random(100,120),pubg.random(-10,10)) Sleep(20) end ReleaseMouseButton(1) Sleep(100) MoveMouseTo(currentMouseX,currentMouseY)end---------------------------------------------------------------------------------一键丢东西=游戏中:ctrl+拖放-------------------------------------------------------------------------------pubg.onDrop=function() localcurrentMouseX,currentMouseY=GetMousePosition() PressMouseButton(1);Sleep(20) fori=1,3do MoveMouseRelative(pubg.random(-126,-100),pubg.random(-10,10)) Sleep(20) end ReleaseMouseButton(1) Sleep(100) MoveMouseTo(currentMouseX,currentMouseY)end---------------------------------------------------------------------------------一键奔跑=游戏中:按=好-------------------------------------------------------------------------------pubg.onAlwayRun=function() PressKey(0x0d) Sleep(400) ReleaseKey(0x0d)end---------------------------------------------------------------------------------自动环视周围-------------------------------------------------------------------------------pubg.onLookAround=function() PressMouseButton(1) repeat MoveMouseRelative(pubg.random(30,70),pubg.random(-1,2)) Sleep(20) untilnotIsMouseButtonPressed(1) ReleaseMouseButton(1)end---------------------------------------------------------------------------------当单独的G键被按下-------------------------------------------------------------------------------pubg.onGKeyPressed=function() pubg.currentWeapon="NIL"end---------------------------------------------------------------------------------选择UMP9枪-------------------------------------------------------------------------------pubg.onWeaponUmp9=function() localweaponRocilData={5,5,5,3,2,3,3,3,3,3,3,3,3,3,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} localweaponDuration=20 localcurrentRecoilPos=1 repeat MoveMouseRelative(pubg.random(-1,2),weaponRocilData[currentRecoilPos]) currentRecoilPos=currentRecoilPos+1 Sleep(weaponDuration) OutputLogMessage(tostring(currentRecoilPos).."") ifcurrentRecoilPos==#weaponRocilDatathen currentRecoilPos=1 end untilnotIsMouseButtonPressed(1)end---------------------------------------------------------------------------------选择AKM枪-------------------------------------------------------------------------------pubg.onWeaponAkm=function() localweaponRocilData={5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} localweaponDuration=20 localcurrentRecoilPos=1 repeat MoveMouseRelative(0,weaponRocilData[currentRecoilPos]) currentRecoilPos=currentRecoilPos+1 Sleep(weaponDuration) OutputLogMessage(tostring(currentRecoilPos).."") ifcurrentRecoilPos==#weaponRocilDatathen currentRecoilPos=1 end untilnotIsMouseButtonPressed(1)end---------------------------------------------------------------------------------选择M16A4枪-------------------------------------------------------------------------------pubg.onWeaponM16a4=function() localweaponRocilData={5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} localweaponDuration=20 localcurrentRecoilPos=1 repeat MoveMouseRelative(pubg.random(-1,2),weaponRocilData[currentRecoilPos]) currentRecoilPos=currentRecoilPos+1 Sleep(weaponDuration) OutputLogMessage(tostring(currentRecoilPos).."") ifcurrentRecoilPos==#weaponRocilDatathen currentRecoilPos=1 elseifcurrentRecoilPos%5==0then ReleaseMouseButton(1) Sleep(10) PressMouseButton(1) Sleep(100) end untilnotIsMouseButtonPressed(1) OutputLogMessage("IsMouseButtonPressed==false\n")end---------------------------------------------------------------------------------选择M416枪-------------------------------------------------------------------------------pubg.onWeaponM416=function() ClearLog() localweaponRocilData={5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3,2,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} localweaponDuration=20 localcurrentRecoilPos=1 repeat MoveMouseRelative(pubg.random(-1,2),weaponRocilData[currentRecoilPos]) currentRecoilPos=currentRecoilPos+1 Sleep(weaponDuration) OutputLogMessage(tostring(currentRecoilPos).."") ifcurrentRecoilPos==#weaponRocilDatathen currentRecoilPos=1 elseifcurrentRecoilPos%5==0then ReleaseMouseButton(1) Sleep(20) PressMouseButton(1) end untilnotIsMouseButtonPressed(1)end---------------------------------------------------------------------------------pubg逻辑处理-------------------------------------------------------------------------------pubg.onEvent=function(event,arg) OutputLogMessage("event=%s,arg=%d\n",event,arg) ifevent=="PROFILE_ACTIVATED"then EnablePrimaryMouseButtonEvents(true) elseifevent=="PROFILE_DEACTIVATED"then EnablePrimaryMouseButtonEvents(false) pubg.currentWeapon="NIL" ReleaseKey(0x1d) ReleaseMouseButton(1) ReleaseMouseButton(2) return end --G键按下逻辑 ifevent=="MOUSE_BUTTON_PRESSED"andarg==6then pubg.isGKeyPressed=true pubg.isOKeyPressed=false elseifevent=="MOUSE_BUTTON_RELEASED"andarg==6then pubg.isGKeyPressed=false end --在G键按下的时候,其他键是否被按下 ifevent=="MOUSE_BUTTON_PRESSED"andarg~=6andpubg.isGKeyPressedthen pubg.isOKeyPressed=true end --单独G键被按下 ifevent=="MOUSE_BUTTON_RELEASED"andarg==6andpubg.isOKeyPressed==falsethen pubg.onGKeyPressed() --一键拾取物品 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyPickupWeaponandpubg.isGKeyPressed==falsethen pubg.onPickupWeapon() --一键丢弃物品 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyDropandpubg.isGKeyPressed==truethen pubg.onDrop() --一键奔跑 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyAlwayRunandpubg.isGKeyPressed==falsethen pubg.onAlwayRun() --自动环视周围 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyLookAroundandIsModifierPressed("alt")then pubg.onLookAround() --选择UMP9 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyWeaponUmp9andpubg.isGKeyPressed==truethen pubg.currentWeapon="UMP9" --选择AKM elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyWeaponAkmandpubg.isGKeyPressed==truethen pubg.currentWeapon="AKM" --选择M16A4 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyWeaponM16a4andpubg.isGKeyPressed==falsethen pubg.currentWeapon="M16A4" --选择M416 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==pubg.keyWeaponM416andpubg.isGKeyPressed==falsethen pubg.currentWeapon="M416" --鼠标左键被按下 elseifevent=="MOUSE_BUTTON_PRESSED"andarg==1then ifpubg.currentWeapon~="NIL"then ifpubg.currentWeapon=="UMP9"then pubg.onWeaponUmp9() elseifpubg.currentWeapon=="AKM"then pubg.onWeaponAkm() elseifpubg.currentWeapon=="M16A4"then pubg.onWeaponM16a4() elseifpubg.currentWeapon=="M416"then pubg.onWeaponM416() end end endend---------------------------------------------------------------------------------驱动入口函数-------------------------------------------------------------------------------functionOnEvent(event,arg) pubg.onEvent(event,arg)end

© 一点知识