-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.lua
More file actions
36 lines (30 loc) · 804 Bytes
/
example.lua
File metadata and controls
36 lines (30 loc) · 804 Bytes
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
local KrissyUtil = require("KrissyUtil")
local LovenseSession = require "SessionAPI"
local Lovense = LovenseSession:new("xxxxxx")
local update_interval = 5
local prev_update = 0
function update_session()
while (os.clock() < (prev_update + update_interval)) do
end
local err = Lovense:get_and_handle_message()
if err ~= nil then
print("[Lovense] Could not connect to server")
return
end
prev_update = os.clock()
end
Lovense:Connect()
print("Connected")
for i = 0, 5 do
update_session()
Lovense:Vibrate(5) -- from 0 to 20 (max)
print("Sent Initial Vibrate (5)")
KrissyUtil:sleep(3)
update_session()
Lovense:Vibrate(0) -- stop vibration
print("Sent Stop Vibrate")
KrissyUtil:sleep(3)
end
update_session()
Lovense:Vibrate(0) -- stop vibration
Lovense:Disconnect("Client Disconnected")