-
Notifications
You must be signed in to change notification settings - Fork 0
/
vmix.py
60 lines (54 loc) · 3.4 KB
/
vmix.py
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
# vmix.py vMix Python Library for Battlebots
import requests
# Scoreboard texts & clock functions
def set_red_score(score, _url):
return requests.get(_url('Function=SetText&Input=Scoreboard&SelectedName=Home Score.Text&Value={:d}'.format(score)))
def set_blue_score(score, _url):
return requests.get(_url('Function=SetText&Input=Scoreboard&SelectedName=Away Score.Text&Value={:d}'.format(score)))
def set_game_clock(time, _url):
return requests.get(_url('Function=SetCountdown&Input=Scoreboard&SelectedName=CLOCK.Text&Value={:s}'.format(time)))
def start_game_clock(_url):
return requests.get(_url('Function=StartCountdown&Input=Scoreboard&SelectedName=CLOCK.Text'))
def stop_game_clock(_url):
return requests.get(_url('Function=StopCountdown&Input=Scoreboard&SelectedName=CLOCK.Text'))
def pause_game_clock(_url):
return requests.get(_url('Function=PauseCountdown&Input=Scoreboard&SelectedName=CLOCK.Text'))
def set_scoreboard_top_text(text, _url):
return requests.get(_url('Function=SetText&Input=Scoreboard&SelectedName=Title 1.Text&Value={:s}'.format(text)))
def set_scoreboard_bottom_text(text, _url):
return requests.get(_url('Function=SetText&Input=Scoreboard&SelectedName=Title 2.Text&Value={:s}'.format(text)))
# Overlays
def overlay_scoreboard_in(_url):
return requests.get(_url('Function=OverlayInput1In&Input=Scoreboard'))
def overlay_scoreboard_out(_url):
return requests.get(_url('Function=OverlayInput1Out&Input=Scoreboard'))
def overlay_match_preview_in(_url):
return requests.get(_url('Function=OverlayInput2In&Input=MatchPreview'))
def overlay_match_preview_out(_url):
return requests.get(_url('Function=OverlayInput2Out&Input=MatchPreview'))
def overlay_match_result_in(_url):
return requests.get(_url('Function=OverlayInput2In&Input=MatchResult'))
def overlay_match_result_out(_url):
return requests.get(_url('Function=OverlayInput2Out&Input=MatchResult'))
# Match Preview
def set_red1_preview(text, _url):
return requests.get(_url('Function=SetText&Input=MatchPreview&SelectedName=Red1.Text&Value={:s}'.format(text)))
def set_red2_preview(text, _url):
return requests.get(_url('Function=SetText&Input=MatchPreview&SelectedName=Red2.Text&Value={:s}'.format(text)))
def set_blue1_preview(text, _url):
return requests.get(_url('Function=SetText&Input=MatchPreview&SelectedName=Blue1.Text&Value={:s}'.format(text)))
def set_blue2_preview(text, _url):
return requests.get(_url('Function=SetText&Input=MatchPreview&SelectedName=Blue2.Text&Value={:s}'.format(text)))
# Match Result
def set_red1_result(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=Red1.Text&Value={:s}'.format(text)))
def set_red2_result(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=Red2.Text&Value={:s}'.format(text)))
def set_blue1_result(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=Blue1.Text&Value={:s}'.format(text)))
def set_blue2_result(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=Blue2.Text&Value={:s}'.format(text)))
def set_red_final_score(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=RedScore.Text&Value={:d}'.format(text)))
def set_blue_final_score(text, _url):
return requests.get(_url('Function=SetText&Input=MatchResult&SelectedName=BlueScore.Text&Value={:d}'.format(text)))