您好,我想结合这 2 个切换脚本。这是为了游戏。我不擅长这个脚本,我需要合并脚本的帮助。我想
- 当我按下 G7 按钮时,当我按下
鼠标左键时,鼠标下拉 x 像素 - 当我按下 g8 按钮
时,当我按下鼠标左键时,鼠标会下拉 y 像素。
脚本1
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
Sleep(2)
MoveMouseRelative(-1, 1)
Sleep(2)
MoveMouseRelative( 0.5 , 2)
Sleep(2)
MoveMouseRelative( 1, 30)
Sleep(6)
until not IsMouseButtonPressed(1)
end
end
end
脚本2
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 8) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
Sleep(2)
MoveMouseRelative(-1, 1)
Sleep(2)
MoveMouseRelative( 0.5 , 2)
Sleep(2)
MoveMouseRelative( 1, 10)
Sleep(6)
until not IsMouseButtonPressed(1)
end
end
end