-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBingoEmotes2_AnkhBotSystem.py
More file actions
371 lines (319 loc) · 10.7 KB
/
Copy pathBingoEmotes2_AnkhBotSystem.py
File metadata and controls
371 lines (319 loc) · 10.7 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
#---------------------------------------
# Import Libraries
#---------------------------------------
import clr, sys, json, os, codecs
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
import random
import time
#---------------------------------------
# [Required] Script Information
#---------------------------------------
ScriptName = "Bingo Emotes2"
Website = ""
Creator = "Yaz12321"
Version = "1.0.1"
Description = "Run the game, and let your viewers spam your chat with emotes until they guess the winning one."
settingsFile = os.path.join(os.path.dirname(__file__), "settings.json")
#---------------------------------------
# Version Information
#---------------------------------------
# Version:
# Version 1.0.1:
# Fixed bugs
# Added timer
# Version 1.0:
# Official Release
class Settings:
# Tries to load settings from file if given
# The 'default' variable names need to match UI_Config
def __init__(self, settingsFile = None):
if settingsFile is not None and os.path.isfile(settingsFile):
with codecs.open(settingsFile, encoding='utf-8-sig',mode='r') as f:
self.__dict__ = json.load(f, encoding='utf-8-sig')
else: #set variables if no settings file
self.OnlyLive = False
self.Command = "!bingo"
self.Permission = "Everyone"
self.PermissionInfo = ""
self.StartPerm = "Everyone"
self.StartPermInfo = ""
self.BaseResponse = "{0} has guessed the secret emote. The emote was {1}. {0} has won {2} {3}. Total time: {4} seconds, or {5} minutes"
self.Payout = 30
self.Start = "Bingo has started. Send emotes (one per message) and guess the emote."
self.TriggerWord = 0
# Reload settings on save through UI
def ReloadSettings(self, data):
self.__dict__ = json.loads(data, encoding='utf-8-sig')
return
# Save settings to files (json and js)
def SaveSettings(self, settingsFile):
with codecs.open(settingsFile, encoding='utf-8-sig',mode='w+') as f:
json.dump(self.__dict__, f, encoding='utf-8-sig')
with codecs.open(settingsFile.replace("json", "js"), encoding='utf-8-sig',mode='w+') as f:
f.write("var settings = {0};".format(json.dumps(self.__dict__, encoding='utf-8-sig')))
return
#---------------------------------------
# Initialize Data on Load
#---------------------------------------
def Init():
# Globals
global MySettings
# Load in saved settings
MySettings = Settings(settingsFile)
# End of Init
return
#---------------------------------------
# Reload Settings on Save
#---------------------------------------
def ReloadSettings(jsonData):
# Globals
global MySettings
# Reload saved settings
MySettings.ReloadSettings(jsonData)
# End of ReloadSettings
return
def Execute(data):
## try:
## word
## except NameError:
## word = ""
if data.IsChatMessage() and data.GetParam(0).lower() == MySettings.Command:
#check if command is in "live only mode"
if MySettings.OnlyLive:
#set run permission
startCheck = Parent.IsLive() and Parent.HasPermission(data.User, MySettings.StartPerm, MySettings.StartPermInfo)
else: #set run permission
startCheck = True
#check if user has permission
if startCheck and Parent.HasPermission(data.User, MySettings.StartPerm, MySettings.StartPerm):
Trigger = 1
nouns = [
'4Head',
'ANELE',
'AngryJack',
'ArgieB8',
'ArigatoNas',
'ArsonNoSexy',
'AsianGlow',
'BabyRage',
'BatChest',
'BCWarrior',
'BegWan',
'BibleThump',
'BigBrother',
'BigPhish',
'BisexualPride',
'BlargNaut',
'bleedPurple',
'BlessRNG',
'BloodTrail',
'BrainSlug',
'BrokeBack',
'BuddhaBar',
'CarlSmile',
'ChefFrank',
'cmonBruh',
'CoolCat',
'CoolStoryBob',
'copyThis',
'CorgiDerp',
'CrreamAwk',
'CurseLit',
'DAESuppy',
'DansGame',
'DarkMode',
'DatSheffy',
'DBstyle',
'DendiFace',
'DogFace',
'DoritosChip',
'DrinkPurple',
'duDudu',
'DxCat',
'EarthDay',
'EleGiggle',
'EntropyWins',
'FailFish',
'FBtouchdown',
'FrankerZ',
'FreakinStinkin',
'FUNgineer',
'FunRun',
'FutureMan',
'GayPride',
'GingerPower',
'GivePLZ',
'GOWAtreus',
'GOWKratos',
'GrammarKing',
'GreenTeam',
'HappyJack',
'HassaanChop',
'HassanChop',
'HeyGuys',
'HotPokket',
'HSCheers',
'HSWP',
'HumbleLife',
'imGlitch',
'InuyoFace',
'ItsBoshyTime',
'Jebaited',
'JKanStyle',
'JonCarnage',
'KAPOW',
'Kappa',
'KappaClaus',
'KappaPride',
'KappaRoss',
'KappaWealth',
'Kappu',
'Keepo',
'KevinTurtle',
'Kippa',
'KomodoHype',
'KonCha',
'Kreygasm',
'LesbianPride',
'LUL',
'Mau5',
'mcaT',
'MercyWing1',
'MercyWing2',
'MikeHogu',
'MingLee',
'MorphinTime',
'MrDestructoid',
'MVGame',
'NinjaGrumpy',
'NomNom',
'NotATK',
'NotLikeThis',
'OhMyDog',
'OneHand',
'OpieOP',
'OptimizePrime',
'OSFrog',
'OSSmooth',
'panicBasket',
'PanicVis',
'PartyHat',
'PartyTime',
'pastaThat',
'PeoplesChamp',
'PermaSmug',
'PicoMause',
'PinkMercy',
'PipeHype',
'PJSalt',
'PJSugar',
'PMSTwin',
'PogChamp',
'Poooound',
'PopCorn',
'PowerUpL',
'PowerUpR',
'PraiseIt',
'PRChase',
'PrimeMe',
'PunchTrees',
'PunOko',
'PurpleStar',
'RaccAttack',
'RalpherZ',
'RedCoat',
'RedTeam',
'ResidentSleeper',
'riPepperonis',
'RitzMitz',
'RlyTho',
'RuleFive',
'SabaPing',
'SeemsGood',
'SeriousSloth',
'ShadyLulu',
'ShazBotstix',
'SmoocherZ',
'SMOrc',
'SoBayed',
'SoonerLater',
'SOTahoy',
'SOTshark',
'Squid1',
'Squid2',
'Squid3',
'Squid4',
'SSSsss',
'StinkyCheese',
'StoneLightning',
'StrawBeary',
'SuperVinlin',
'SwiftRage',
'TakeNRG',
'TBAngel',
'TearGlove',
'TehePelo',
'TF2John',
'ThankEgg',
'TheIlluminati',
'TheRinger',
'TheTarFu',
'TheThing',
'ThunBeast',
'TinyFace',
'TombRaid',
'TooSpicy',
'TPcrunchyroll',
'TPFufun',
'TransgenderPride',
'TriHard',
'TTours',
'TwitchLit',
'twitchRaid',
'TwitchRPG',
'TwitchUnity',
'TwitchVotes',
'UncleNox',
'UnSane',
'UWot',
'VoHiYo',
'VoteNay',
'VoteYea',
'WholeWheat',
'WTRuck',
'WutFace',
'YouDontSay',
'YouWHY',
]
global word
wordnum = Parent.GetRandom(0,len(nouns))
word = nouns[wordnum]
#word = random.choice(nouns)
Parent.SendStreamWhisper(MySettings.Streamer,word)
Parent.SendTwitchMessage(MySettings.Start)
global t1
t1 = time.time()
TriggerWord = 0
if data.IsChatMessage() and data.GetParam(0).lower():
try:
word
except NameError:
a = 1
else:
if data.GetParam(0) == word:
#give user points
Parent.AddPoints(data.User,data.UserName,MySettings.Payout)
timer = time.time() - t1
timermin = timer / 60
#announce winner.
Parent.SendTwitchMessage(MySettings.BaseResponse.format(data.UserName,word,MySettings.Payout,Parent.GetCurrencyName(),timer,timermin))
#reset secret word to null
word = ""
return
def Tick():
return
def UpdateSettings():
with open(m_ConfigFile) as ConfigFile:
MySettings.__dict__ = json.load(ConfigFile)
return