EnablePrimaryMouseButtonEvents(true)
local all_button = 9
local is_open_up = false
function OnEvent(event, arg)
OutputLogMessage('Event: '..event..', Arg: '..arg..'\n')
if (event == "MOUSE_BUTTON_PRESSED" and arg == all_button) then
is_open_up = not is_open_up
if is_open_up then
OutputLogMessage("开 on \n")
OutputLogMessage("关 off \n")
if (is_open_up and IsMouseButtonPressed(5)) then
OutputLogMessage("进入节奏 (F8)\n")
repeat
PressKey("f8")
Sleep(math.random(15, 20))
ReleaseKey("f8")
Sleep(math.random(40, 60))
until not IsMouseButtonPressed(5)
OutputLogMessage("进入节奏终止 (F8)\n")
if (is_open_up and IsMouseButtonPressed(4)) then
OutputLogMessage("进入节奏 (F9)\n")
repeat
PressKey("f9")
Sleep(math.random(15, 20))
ReleaseKey("f9")
Sleep(math.random(40, 60))
until not IsMouseButtonPressed(4)
OutputLogMessage("进入节奏终止 (F9)\n")
该项目持续更新 在github gitee
gitee地址
当然罗技键盘我也写了发下代码用ALT 退出循环
EnablePrimaryMouseButtonEvents(true)
local all_button = 3
local is_open_up = false
function OnEvent(event, arg)
OutputLogMessage('Event: '..event..', Arg: '..arg..'\n')
if (event == "G_PRESSED" and arg == all_button) then
is_open_up = not is_open_up
if is_open_up then
OutputLogMessage("开 on \n")
OutputLogMessage("关 off \n")
if (is_open_up and event == "G_PRESSED" and arg ==1) then
OutputLogMessage("进入节奏 (F8)\n")
repeat
PressKey("f8")
Sleep(math.random(15, 20))
ReleaseKey("f8")
Sleep(math.random(40, 60))
until IsModifierPressed("alt")
OutputLogMessage("进入节奏终止 (F8)\n")
if (is_open_up and event == "G_PRESSED" and arg ==2) then
OutputLogMessage("进入节奏 (F9)\n")
repeat
PressKey("f9")
Sleep(math.random(15, 20))
ReleaseKey("f9")
Sleep(math.random(40, 60))
until IsModifierPressed("alt")
OutputLogMessage("进入节奏终止 (F9)\n")
年底我会出罗技教程
以前玩暗黑破坏神3,为了不至于断手,尝试了一下网络上提供的lua脚本,但全部使用的是死循环,消息被阻塞,而且创建新的职业脚本很麻烦,所以,尝试了这个框架,代码中的实际样例是用于猎魔人的多重射击,有兴趣的可以自行修改用于其他职业,严重缺CSDN积分,如果要转载到其他地方发布,请联系我。
里面的用法注释很详细,至于框架部分,不明白的不要修改。