-
Notifications
You must be signed in to change notification settings - Fork 0
/
DXMacros blank.lua
91 lines (77 loc) · 1.98 KB
/
DXMacros blank.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
--By: DX
--Twitter: twitter.com/DX_Nacca
--Twitch: twitch.tv/dx___
--YouTube: youtube.com/canal0gamers
--Activates the setting [ true / false ]
setting = false
--device ID
device = ''
--Automatically minimize [ true / false ]
minimize = false
--when minimize go to Tray [ true / false ]
lmc.minimizeToTray = true
keys = {}
-- Add the commands here --
---------- Dont touch ----------
if( minimize ) then
lmc.minimizeToTray = true
lmc_minimize()
end
inicio = false
if(device == '') then
lmc_assign_keyboard('MACROS')
dev = lmc_get_devices()
for key,value in pairs(dev) do
if( value["Name"] == 'MACROS' ) then
id= string.sub(string.match(value["SystemId"],"#[0-9a-zA-Z]&[0-9a-zA-Z]*"),4,-1)
print("device = '"..id.."'")
inicio = true
end
end
else
lmc_device_set_name('MACROS',device)
inicio = true
end
if(inicio) then
if( setting ) then
print("-------------[ SETTING MODE ]-------------")
temp=false
modifire={'+','^','%'}
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end
if ( keys[button] == nil and temp) then
c=0
tt=true
while tt do
f=true
t= modifire[math.floor(c/12)+1] .. "{F" .. (c%12 + 13) .. "}"
for i,v in pairs(keys) do
if( v == t ) and f then
f=false
end
end
if( f ) then
tt=false
keys[button]=t
print("keys["..button.."]"..string.rep(" ",4-string.len(tostring(button))).. "= '"..t.."' --")
else
c=c+1
end
end
end
temp = true
end)
else
print("-------------[ USE MODE ]-------------")
lmc_set_handler('MACROS',function(button, direction)
if (direction == 1) then return end
if ( keys[button] == nil ) then
--print('key undefined: ' .. button)
else
lmc_send_keys(keys[button], 50)
end
end)
end
else
print("The device was not found")
end