-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOBSBOT Tiny 2 Lite GUI.ahk
More file actions
78 lines (66 loc) · 2.52 KB
/
Copy pathOBSBOT Tiny 2 Lite GUI.ahk
File metadata and controls
78 lines (66 loc) · 2.52 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
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
; Uses UDP Server
; Requires AHK64
; This example does not make use of OBSBOTController library, instead it calls the dll directly
#NoEnv
#SingleInstance Force
SetBatchLines -1
Gui +LastFound
hWnd := WinExist()
ip := "127.0.0.1"
port := 16284
OnExit, exitGracefully
; Load DLL
DllCall("LoadLibrary", "Str", A_ScriptDir "\lib\OSC2AHKv1.2.dll", "Ptr")
Gui Add, Button, x8 y8 w80 h23 grecord, Record
Gui Add, Button, x104 y8 w80 h23 gstopRecording, Stop Recording
Gui Add, Button, x8 y40 w80 h23 gsleep, Sleep
Gui Add, Button, x104 y40 w80 h23 gwake, Wake
Gui Add, Button, x8 y72 w80 h23 gsetCoords, Coords preset
Gui Add, Button, x104 y72 w80 h23 gresetCoords, Reset Coords
Gui Add, Edit, hWndhEdtValue x200 y8 w120 h21 vspeed
SendMessage 0x1501, 1, "Speed: 0-90",, ahk_id %hEdtValue%
Gui Add, Edit, hWndhEdtValue2 x200 y40 w120 h21 vpan
SendMessage 0x1501, 1, "Pan: -129 - 129",, ahk_id %hEdtValue2%
Gui Add, Edit, hWndhEdtValue3 x200 y72 w120 h21 vpitch
SendMessage 0x1501, 1, "Pitch: -59 - 59",, ahk_id %hEdtValue3%
Gui Add, Button, x216 y104 w80 h23 gsetCustomCoords, CUSTOM
Gui Show, w339 h136, OBSBOT
Return
exitGracefully:
GuiEscape:
GuiClose:
DllCall("FreeLibrary", "Ptr", A_ScriptDir "\lib\OSC2AHKv1.2.dll")
ExitApp
; Send OSC message with integer payload to record
record:
addr := "/OBSBOT/WebCam/General/SetPCRecording"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, 1)
return
; Send OSC message with integer payload to stop recording
stopRecording:
addr := "/OBSBOT/WebCam/General/SetPCRecording"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, 0)
return
wake:
addr := "/OBSBOT/WebCam/General/WakeSleep"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, 1)
return
sleep:
addr := "/OBSBOT/WebCam/General/WakeSleep"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, 0)
return
resetCoords:
addr := "/OBSBOT/WebCam/General/ResetGimbal"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, 0)
return
setCoords:
addr := "/OBSBOT/WebCam/General/SetGimMotorDegree"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInts", AStr, ip, UInt, port, AStr, addr, Int, 3, Int, 45, Int, 45, Int, 45)
return
setCustomCoords:
GuiControlGet, speed,, speed
GuiControlGet, pan,, pan
GuiControlGet, pitch,, pitch
addr := "/OBSBOT/WebCam/General/SetGimMotorDegree"
DllCall("OSC2AHKv1.2.dll\sendOscMessageInts", AStr, ip, UInt, port, AStr, addr, Int, 3, Int, speed, Int, pan, Int, pitch)
return