local
n = false
local
SideKey = {
4
,
5
,
6
,
7
,
8
}
local
Gun
local
Guns = { M4, Vector, AKM, M762, Groza, M249, AUG, Scarl}
function
OnEvent(event ,
arg
)
EnablePrimaryMouseButtonEvents(true)
MBP =
"MOUSE_BUTTON_PRESSED"
MBR =
"MOUSE_BUTTON_RELEASED"
if
( event == MBP
and
arg
==
4
)
then
n=true
LightingTips(
4
)
end
if
( event == MBP
and
arg
==
5
)
then
n=true
LightingTips(
5
)
end
IsLeftPress(Gun)
这里我想的是:在前面的LightingTips函数里在不同的侧键按下后给Gun赋予不同的值(我这里是M4 Vector),然后进入IsLeftPress的
if
中判断Gun,
当等于M4就进入M4的循环。但是问题出就出在不管是进入M4还是Vector,都是用的M4的压强系数,这里有个罗技里的测试截图
[attach]
1907544
[/attach]
所以我想解决的就是让它能在我按下
4
号侧键时用M4系数压,按下
5
号侧键时用Vector的系数
if
( event == MBP
and
arg
==
6
)
then
n=false
LightingTips(
6
)
end
end
function
IsLeftPress(Gun)
if
( IsMouseButtonPressed(
1
)
and
n )
then
MoveFunc(Gun)
end
end
function
MoveFunc(Gun)
if
(Gun == M4 )
then
OutputLogMessage(
"M4.ing\n"
)
repeat
MoveMouseRelative(
0
,
1
)
Sleep(
10
)
until
not
IsMouseButtonPressed(
1
)
elseif
(Gun == Vector)
then
OutputLogMessage(
"Vector.ing\n"
)
repeat
MoveMouseRelative(
0
,
4
)
Sleep(
10
)
until
not
IsMouseButtonPressed(
1
)
end
function
LightingTips(Num)
if
(Num ==
4
)
then
TuOn()
OutputLogMessage(
"M4 on!\n"
)
Gun=M4
elseif
(Num ==
5
)
then
TuOn()
OutputLogMessage(
"Vector on!\n"
)
Gun=Vector
elseif
(Num ==
6
)
then
TuOf()
ClearLog()
OutputLogMessage(
"norecoil off!\n"
)
end
end
function
TuOn()
if
(
not
IsKeyLockOn(
"scrolllock"
) )
then
PressAndReleaseKey(
"scrolllock"
);
end
end
function
TuOf()
if
(IsKeyLockOn(
"scrolllock"
))
then
PressAndReleaseKey(
"scrolllock"
);
end
end