Skip to content

Commit bbf023a

Browse files
authored
Merge pull request #26 from kiccer/test
Test
2 parents 355fc20 + 63e0da3 commit bbf023a

File tree

3 files changed

+73
-1
lines changed

3 files changed

+73
-1
lines changed

Soldier76.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pubg = {
191191
gunIndex = 1, -- 选中枪械下标
192192
counter = 0, -- 计数器
193193
xCounter = 0, -- x计数器
194-
sleep = 1, -- 频率设置 (这里不能设置成0,调试会出BUG)
194+
sleep = 5, -- 频率设置 (这里不能设置成0,调试会出BUG)
195195
sleepRandom = { 5, 10 }, -- 防检测随机延迟
196196
startTime = 0, -- 鼠标按下时记录脚本运行时间戳
197197
prevTime = 0, -- 记录上一轮脚本运行时间戳

test/MoveMouseRelative.lua

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
G1 = false
2+
3+
function loop ()
4+
PressAndReleaseMouseButton(1)
5+
MoveMouseRelative(0, 30)
6+
Sleep(20)
7+
end
8+
9+
function OnEvent(event, arg, family)
10+
--OutputLogMessage("event = %s, arg = %s\n", event, arg);
11+
if not IsKeyLockOn("capslock") then return false end
12+
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and family == "mouse" then
13+
G1 = true
14+
SetMKeyState(1)
15+
end
16+
17+
if event == "MOUSE_BUTTON_RELEASED" and arg == 1 and family == "mouse" then
18+
G1 = false
19+
end
20+
21+
if event == "M_PRESSED" and arg == 1 and G1 then
22+
loop()
23+
SetMKeyState(1)
24+
end
25+
26+
end
27+
ClearLog()
28+
EnablePrimaryMouseButtonEvents(true) -- Enable left mouse button event reporting

test/vortex.lua

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
G1 = false
2+
step = 1
3+
counter = 0
4+
direction = {
5+
{1, 0},
6+
{0, 1},
7+
{-1, 0},
8+
{0, -1}
9+
}
10+
11+
function loop ()
12+
PressAndReleaseMouseButton(1)
13+
local d = direction[step % 4 + 1]
14+
MoveMouseRelative(d[1] * 10, d[2] * 10)
15+
counter = counter + 1
16+
if counter == step + 1 then
17+
counter = 0
18+
step = step + 1
19+
end
20+
Sleep(10)
21+
end
22+
23+
function OnEvent(event, arg, family)
24+
--OutputLogMessage("event = %s, arg = %s\n", event, arg);
25+
if not IsKeyLockOn("capslock") then return false end
26+
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and family == "mouse" then
27+
G1 = true
28+
SetMKeyState(1)
29+
end
30+
31+
if event == "MOUSE_BUTTON_RELEASED" and arg == 1 and family == "mouse" then
32+
G1 = false
33+
counter = 0
34+
step = 1
35+
end
36+
37+
if event == "M_PRESSED" and arg == 1 and G1 then
38+
loop()
39+
SetMKeyState(1)
40+
end
41+
42+
end
43+
ClearLog()
44+
EnablePrimaryMouseButtonEvents(true) -- Enable left mouse button event reporting

0 commit comments

Comments
 (0)