- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloading.lua
More file actions
Latest commit
51 lines (42 loc) · 1.08 KB
/
Copy pathloading.lua
File metadata and controls
51 lines (42 loc) · 1.08 KB
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
-- local pollnet = require("pollnet")
-- local json = require("json")
localbuttplug=SMODS.load_file("buttplug.lua")()
-- get system Sleep function
localffi=require("ffi")
ffi.cdef[[
voidSleep(intms);
]]
localsleep
ifffi.os=="Windows" then
functionsleep(s)
ffi.C.Sleep(s)
end
else
functionsleep(s)
ffi.C.poll(nil, 0, s)
end
end
-- Ask for the device list after we connect
table.insert(buttplug.cb.ServerInfo, function()
buttplug.request_device_list()
end)
-- Start scanning if the device list was empty
table.insert(buttplug.cb.DeviceList, function()
ifbuttplug.count_devices() ==0then
buttplug.start_scanning()
end
end)
-- Stop scanning after the first device is found
table.insert(buttplug.cb.DeviceAdded, function()
buttplug.stop_scanning()
end)
-- Start scanning if we lose a device
table.insert(buttplug.cb.DeviceRemoved, function()
buttplug.start_scanning()
end)
-- "Simulated" game loop
function_init()
buttplug.connect("lust-balatro-mod", "ws://localhost:12345")
Lust.buttplug=buttplug
end
_init()