-
Notifications
You must be signed in to change notification settings - Fork 0
/
radiocheck.py
44 lines (39 loc) · 1.24 KB
/
radiocheck.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
import random
from quality import QualityLevel
responses = {
QualityLevel.EXCELLENT: [
"{name}, reading you 5 by 5 from {loc}",
"Good copy {name}, from {loc}",
"Ack {name}, got a strong signal from {loc}",
],
QualityLevel.VERY_GOOD: [
"reading you 5 by 5 {name} from {loc}",
"Good copy {name}, from {loc}",
"Ack {name}, got a strong signal from {loc}",
],
QualityLevel.GOOD: [
"{name}, copy from {loc}",
"Ack {name} from {loc}",
"{name}, got you here in {loc}",
],
QualityLevel.FAIR: [
"{name}, copy from {loc}",
"Ack {name} from {loc}",
"{name}, got you here in {loc}",
],
QualityLevel.POOR: [
"Copy {name}, weak signal from {loc}",
"{name}, barely got you from {loc}",
"Ack {name}, but weak signal from {loc}",
],
QualityLevel.VERY_POOR: [
"Copy {name}, weak signal from {loc}",
"{name}, barely got you from {loc}",
"Ack {name}, but weak signal from {loc}",
],
}
def getResponse(qualityLevel, name, loc):
if qualityLevel not in responses:
return "Hola!"
response = random.choice(responses[qualityLevel])
return response.format(name=name, loc=loc)