summaryrefslogtreecommitdiff
path: root/src/gizmo/wasp-scripted.el
blob: 3ead364fd6cdb15c9f890c67b2ff708cc019fda2 (plain)
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
;;; wasp-scripted --- Scripted episode -*- lexical-binding: t; -*-
;;; Commentary:
;;; Code:

(require 'wasp-utils)
(require 'wasp-twitch)

(defconst w/scripted-chatters
  '( ;; lurkers:
     "UpsideDownNoodle"
     "obtuse_racoon"
     "helldev1338"
     "wfwef325345"
     "hyperx_1139"
     "doubleweed23"
     "silver_sanguine"
     "BigBigFrogVT"
     "fef_wef_wef"
     "scenichighway2000"
     "unbeatablePanda"
     "retroFreak99"
     "UMBERTO777"
     "gfxfanX2"
     "NUMBER_LOVE"
     "hearthstoneVT"
     "AkumaJuliusCh"
     "derivedfunsum"
     "acegamingtime2"
     "Devious_Strength"
     "seadogseadog"
     "DevMAX123"
     "queueinging"
     "cannabis7man"
     "Obscurantism"
     "camelotCannot"
     "RealManTwitch"
     "ANIMAL2Ch"
     "winner_dinner"
     "NANDGATEGIRL"
     "devil3"
     "PitViperVT"
     "terminaldog456"
     "unwashedplate"
     "chef_chef"
     "ThePuppetmasterGaming"
     "GothDragon"
     "byholydog"
     "CodingLord04"
     "gemivemi"
     "drascoTabasco"
     "UNREALITY_FAN"
     "dubiousdiskjockey"
     "ubertuber"
     "celerityVT"
     "BabyYodaFan55"
     "xXpyrexdestroyerXx"
     "hellodogworld"
     ;; scripted chatters:
     "UltraTomato"
     "lord35"
     "SUPER_TROOPER"
     "TheBeastlyNature"
     "cameldromedary"
     "Howdy_Kekw"
     "Zuvius222"
     "AnthonyRabbit"
     ))

(defconst w/scripted-chatter-colors
  (--map
    (cons it (w/color-value-to-html-code (list (random 65546) (random 65536) (random 65536))))
    w/scripted-chatters))

(defconst w/scripted-chatter-sigils
  (--map
    (cons it
      (s-concat
        (if (= (random 2) 0) "💎")
        (if (not (= (random 8) 0)) "💻")))
    w/scripted-chatters))

(defun w/scripted-run-one (cmd)
  "Run a single scripted CMD."
  (when (listp cmd)
    (let ( (_timestamp (car cmd))
           (ty (cadr cmd))
           (args (cddr cmd)))
      (cl-case ty
        (msg
          (let* ( (user (car args))
                  (text (cadr args))
                  (biblicality (w/bible-colorize-sentence text))
                  (text-colored-bible (car biblicality))
                  (text-with-emotes
                    (w/twitch-add-7tv-emotes
                      text-colored-bible)))
            (w/chat-write-message
              (w/make-chat-message
                :user user
                :id nil
                :text text-with-emotes
                :user-color (w/saget user w/scripted-chatter-colors)
                :biblicality (cdr biblicality)
                :sigil (w/saget user w/scripted-chatter-sigils)))))
        (say
          (w/twitch-say (car args)))
        (redeem
          (-let* ( ((user redeem input) args))
            (w/twitch-handle-redeem-helper user redeem input)))
        (resub
          (-let [user (car args)]
            (w/thank-sub user)
            (w/chat-write-event (format "New subscriber: %s" user))))
        (raid
          (soundboard//play-clip "rampage.mp3")
          (w/chat-write-event (format "%s just raided!" (car args))))
        ))))

(defvar w/scripted-time 0)
(defvar w/scripted-script-live nil)
(defconst w/scripted-script
  '( (0 msg "UpsideDownNoodle" "Joel")
     (3 msg "obtuse_racoon" "Joel")
     (4 say "JoelCheck")
     (6 msg "helldev1338" "Joel")
     (7 msg "wfwef325345" "Joel")
     (11 msg "hyperx_1139" "Joel")
     (15 msg "doubleweed23" "hi")
     (25 msg "silver_sanguine" "gomoco")
     (32 msg "BigBigFrogVT" "hello!")
     (40 msg "fef_wef_wef" "hello computer")
     (42 resub "few_wef_wef")
     (45 redeem "scenichighway2000" "BOOST" "")
     (52 msg "unbeatablePanda" "omg hiii")
     (60 msg "retroFreak99" "hello")
     (63 redeem "unbeatablePanda" "BOOST" "")
     (64 redeem "unbeatablePanda" "TSOOB" "")
     (70 resub "doubleweed23")
     (80 msg "UMBERTO777" "Joeler")
     (90 msg "gfxfanX2" "hello male")
     (94 msg "NUMBER_LOVE" "Joel")
     (100 redeem "gfxfanX2" "TSOOB" "")
     (110 resub "UMBERTO777" "")
     (115 msg "hyperx_1139" "Joeler")
     (115 msg "obtuse_racoon" "!glebt")
     (116 msg "glebtbot" "glebt acknowledged")
     (120 redeem "NUMBER_LOVE" "TSOOB" "")
     (125 msg "lord35" "Joel")
     (130 msg "hearthstoneVT" "Hello! :D")
     (134 redeem "hearthstoneVT" "BOOST" "")
     (142 raid "AkumaJuliusCh")
     (150 msg "derivedfunsum" "what are we doing today?")
     (160 msg "gfxfanX2" "!today")
     (161 say "completely normal stream")
     (163 msg "AkumaJuliusCh" "I was playing pokemon polished crystal")
     (164 msg "derivedfunsum" "Pog")
     (180 msg "acegamingtime2" "What's going on in here?")
     (181 msg "silver_sanguine" "yooo")
     (192 msg "acegamingtime2" "Gotcha. Well, I'll be lurking at work, as usual!")
     (197 redeem "Devious_Strength" "lurker check in" "")
     (205 msg "doubleweed23" "good bit ICANT")
     (211 redeem "UpsideDownNoodle" "lurker check in" "")
     (220 redeem "doubleweed23" "BOOST" "")
     (225 redeem "seadogseadog" "BOOST" "")
     (226 redeem "seadogseadog" "TSOOB" "")
     (250 msg "DevMAX123" "i'm new here what's he doing?" "")
     (260 msg "wfwef325345" "@devmax123 clonking it up" "")
     (265 msg "DevMAX123" "wtf" "")
     (266 redeem "queueinging" "BOOST" "")
     (280 msg "queueinging" "hello clonker")
     (290 msg "queueinging" "what are we up to today? short title?")
     (305 msg "retroFreak99" "normal stream mode ydwc")
     (310 msg "DevMAX123" "any advice on learning coding? i'm in school and i want to do devops")
     (330 msg "cannabis7man" "Joel")
     (332 msg "hyperx_1139" "!glebt")
     (333 msg "glebtbot" "glebt acknowledged")
     (340 msg "Obscurantism" "Hello hello")
     (350 msg "UMBERTO777" "@Obscurantism hello")
     (360 msg "Obscurantism" "Not bad. Worked on my game, made some progress on pathfinding.")
     (366 msg "Obscurantism" "Hello Umberto!")
     (370 msg "camelotCannot" "what language is this")
     (380 msg "camelotCannot" "oic never heard of that :D")
     (385 redeem "RealManTwitch" "BOOST" "")
     (387 redeem "ANIMAL2CH" "BOOST" "")
     (390 msg "derivedfunsum" "what did you do this weekend? how is maude?")
     (395 redeem "ANIMAL2CH" "TSOOB" "")
     (400 msg "winner_dinner" "Joel")
     (405 redeem "winner_dinner" "BOOST" "")
     (408 msg "NANDGATEGIRL" ":3")
     (415 msg "NANDGATEGIRL" "have you heard of Baroque? i played the saturn version on saturday")
     (420 redeem "devil3" "lurker check in" "")
     (422 msg "hyperx_1139" "baroque is kino")
     (425 msg "hyperx_1139" "love that game")
     (440 msg "PitViperVT" "omg lcolonq hi")
     (442 msg "PitViperVT" "I see we're looking at wikipedia again ydwc")
     (445 msg "terminaldog456" "hello computer i'm here now gomoco")
     (450 msg "camelotCannot" "what is gomoco")
     (457 redeem "seadogseadog" "lurker check in" "")
     (460 msg "terminaldog456" "i wanted to work on stuff this weekend but i wound up playing games")
     (470 msg "AkumaJuliusCh" "i'm going to get some food and go to bed. have a good stream!")
     (473 redeem "unwashedplate" "lurker check in" "")
     (474 redeem "chef_chef" "lurker check in" "")
     (480 msg "gfxfanX2" "Are you doing ELF stuff?")
     (482 msg "ThePuppetmasterGaming" "Joel")
     (485 redeem "GothDragon" "TSOOB" "")
     (488 redeem "camelotCannot" "TSOOB" "")
     (494 msg "hearthstoneVT" "I never know what's happening around here but I'm glad you're having fun")
     (497 redeem "byholydog" "BOOST" "")
     (510 redeem "byholydog" "total clarity" "")
     (511 msg "byholydog" "thank you")
     (512 msg "GothDragon" "thank you")
     (512 msg "terminaldog456" "thank you")
     (514 msg "PitViperVT" "thank you")
     (518 msg "winner_dinner" "@NANDGATEGIRL i think i had that on the wii as a kid")
     (530 msg "CodingLord04" "hello, how do I learn Python? I want to get an AI job")
     (533 msg "gemivemi" "Joeling")
     (534 redeem "gemivemi" "BOOST" "")
     (536 redeem "drascoTabasco" "lurker check in" "")
     (538 redeem "UNREALITY_FAN" "BOOST" "")
     (540 msg "UNREALITY_FAN" "hello hello hello")
     (541 msg "UNREALITY_FAN" "any boosters?")
     (544 msg "GothDragon" "BOOST")
     (545 msg "gfxfanX2" "nice")
     (546 redeem "seadogseadog" "BOOST" "")
     (546 redeem "dubiousdiskjockey" "BOOST" "")
     (548 redeem "ubertuber" "BOOST" "")
     (550 redeem "celerityVT" "BOOST" "")
     (552 redeem "BabyYodaFan55" "BOOST" "")
     (555 msg "celerityVT" "thank you for the so")
     (560 redeem "BabyYodaFan55" "arrow" "loves baby yoda")
     (562 msg "xXpyrexdestroyerXx" "yo yo")
     (563 resub "xXpyrexdestroyerXx")
     (564 redeem "hellodogworld" "BOOST" "")
     (570 msg "silver_sanguine" "how are maude's teeth?")
     (575 redeem "ANIMAL2CH" "theme: bio" "")
     (578 msg "UltraTomato" "what's up freak bitches")
     (580 msg "lord35" "Joeler hi")
     (585 msg "SUPER_TROOPER" "ICANT")
     (586 msg "TheBeastlyNature" "ICANT")
     (587 msg "ubertuber" "ICANT")
     (588 msg "gemivemi" "ICANT")
     (589 msg "terminaldog456" "ICANT")
     (590 msg "winner_dinner" "ICANT")
     (591 msg "fef_wef_wef" "ICANT")
     (592 msg "cameldromedary" "ICANT")
     (593 msg "Howdy_Kekw" "ICANT")
     (594 msg "Zuvius222" "ICANT")
     (595 msg "AnthonyRabbit" "ICANT")
     (596 msg "hyperx_1139" "ICANT")
     (597 msg "CodingLord04" "ICANT")
     (598 msg "NANDGATEGIRL" "ICANT")
     (599 msg "unbeatablePanda" "ICANT")
     (600 msg "obtuse_racoon" "ICANT")
     (601 say "ICANT")
     (602 say "ICANT")
     (603 say "ICANT")
     (604 say "ICANT")
     (605 say "ICANT")
     (606 say "ICANT")
     (607 say "ICANT")
     (608 say "ICANT")
     (609 say "ICANT")
     (610 say "ICANT")
     (611 say "ICANT")
     (612 say "ICANT")
     (613 say "ICANT")
     (614 say "ICANT")
     (615 say "ICANT")
     (616 say "ICANT")
     (617 say "ICANT")
     (618 say "ICANT")
     (619 say "ICANT")))

(defun w/scripted-run-next-if-ready ()
  "Run the next script entry if ready."
  (let* ( (next (car w/scripted-script-live))
          (ts (car next)))
    (when (and ts (< (* ts 2) w/scripted-time))
      (w/scripted-run-one next)
      (pop w/scripted-script-live))))

(defvar w/scripted-update-timer nil)
(defun w/scripted-run-update-timer ()
  "Run the script update timer."
  (when w/scripted-update-timer
    (cancel-timer w/scripted-update-timer))
  (incf w/scripted-time)
  (if (null w/scripted-script-live)
    (w/scripted-run-one
      `(0 msg ,(w/pick-random w/scripted-chatters) "This is a normal stream."))
    (w/scripted-run-next-if-ready))
  (setq
    w/scripted-update-timer
    (run-with-timer 1 nil #'w/scripted-run-update-timer)))

(defun w/scripted-start ()
  "Start the script."
  (w/chat-clear)
  (setf w/scripted-time 0)
  (setf w/scripted-script-live w/scripted-script)
  (setf w/twitch-boosters nil)
  (w/scripted-run-update-timer))

(defun w/scripted-stop ()
  "Start the script."
  (when w/scripted-update-timer
    (cancel-timer w/scripted-update-timer)
    (setf w/scripted-update-timer nil)))

(provide 'wasp-scripted)
;;; wasp-scripted.el ends here