-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathjackpot.v2.mrc
580 lines (536 loc) · 25.9 KB
/
jackpot.v2.mrc
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BLASBOT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;; TWITCH.TV/BLASMAN13 ;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;; JACKPOT VERSION 2.1.0.9 ;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Online Documentation @ https://github.com/Blasman/mIRC-Twitch-Scripts/wiki/Script-Documentation#jackpot-version-21
alias jackpot_version return 2.1.0.9
ON *:LOAD: jackpot_setup
ON *:UNLOAD: UNSET %jackpot.*
alias jackpot_setup {
IF ($blasbot_version < 1.0.0.6) {
$dialog(jackpot_important,jackpot_important)
url -m https://github.com/Blasman/mIRC-Twitch-Scripts/wiki/Script-Documentation
unload -rs jackpot.v2.mrc
halt
}
IF (!%jackpot.odds) SET %jackpot.odds 1.234
jp_odds
jp_emotes
jp_cost
jp_cooldown
jp_newpot
IF (!%jackpot.reel_1_speed) SET %jackpot.reel_1_speed 1
IF (!%jackpot.reel_2_speed) SET %jackpot.reel_2_speed 3
IF (!%jackpot.reel_3a_speed) SET %jackpot.reel_3a_speed 5
IF (!%jackpot.reel_3b_speed) SET %jackpot.reel_3b_speed 6
IF (!%jackpot.reel_3c_speed) SET %jackpot.reel_3c_speed 7
IF (!%jackpot.lose_msg) SET %jackpot.lose_msg ::: You Lose, user! Better luck next time! BibleThump
IF (!%jackpot.pull_msg) SET %jackpot.pull_msg user pulls the jackpot machine's lever... PogChamp [Current Jackpot: jptotal]
IF (!%jackpot.whispers) SET %jackpot.whispers Off
IF (!%jackpot.sound_livecheck) SET %jackpot.sound_livecheck On
IF (!%jackpot.myjackpot) SET %jackpot.myjackpot On
IF (!%jackpot.myjackpot_whispers) SET %jackpot.myjackpot_whispers Off
IF (!%jackpot.stats) SET %jackpot.stats On
IF (!%jackpot.record) SET %jackpot.record On
IF (!%jackpot.addicts) SET %jackpot.addicts On
IF (!%jackpot.winners) SET %jackpot.winners On
IF (!%jackpot.netwinners) SET %jackpot.netwinners On
}
dialog jackpot_important {
title "IMPORTANT!"
size -1 -1 200 60
option dbu
text "You are NOT running the latest version of blasbot.mrc from Blasman's GitHub. This script will NOT work for you until you install it! Setup will exit once you click Okay.", 1, 8 8 180 30
button "Okay", 3, 80 45 40 12, ok
}
menu menubar,channel,status {
!JackPot
.$style(2) Version $jackpot_version:$null
.!JackPot is $IIF(%GAMES_JACKPOT_ACTIVE,ON,OFF) [click to $IIF(%GAMES_JACKPOT_ACTIVE,disable,enable) $+ ]:jp_switch
.EMOTES
..CLICK HERE TO CONFIGURE:jp_emotes
..$submenu($_jackpot_emote_menu($1))
.REEL SPEED
..FIRST REEL $chr(91) $+ %jackpot.reel_1_speed seconds $+ $chr(93):jp_reelspeed_1
..SECOND REEL $chr(91) $+ %jackpot.reel_2_speed seconds $+ $chr(93):jp_reelspeed_2
..THIRD LOSING REEL if first two reels are NOT identical $chr(91) $+ %jackpot.reel_3a_speed seconds $+ $chr(93):jp_reelspeed_3a
..THIRD LOSING REEL if first two reels ARE identical $chr(91) $+ %jackpot.reel_3b_speed seconds $+ $chr(93):jp_reelspeed_3b
..THIRD WINNING REEL $chr(91) $+ %jackpot.reel_3c_speed seconds $+ $chr(93):jp_reelspeed_3c
.MESSAGES
..LEVER PULL MESSAGE [click to change]:jp_pullmsg
..LOSE MESSAGE [click to change]:jp_losemsg
.EXTRA COMMANDS
..'!myjackpot' is $IIF(%jackpot.myjackpot == On,ON,OFF) [click to $IIF(%jackpot.myjackpot == On,disable,enable) $+ ]:jp_myjackpot
..If enabled $+ $chr(44) '!myjackpot' WHISPER MODE is set to $IIF(%jackpot.myjackpot_whispers == On,ON,OFF) [click to $IIF(%jackpot.myjackpot_whispers == On,disable,enable) $+ ]:jp_myjackpot_whispers
..'!jackpot stats' is $IIF(%jackpot.stats == On,ON,OFF) [click to $IIF(%jackpot.stats == On,disable,enable) $+ ]:jp_stats
..'!jackpot record' is $IIF(%jackpot.record == On,ON,OFF) [click to $IIF(%jackpot.record == On,disable,enable) $+ ]:jp_record
..'!jackpot addicts' is $IIF(%jackpot.addicts == On,ON,OFF) [click to $IIF(%jackpot.addicts == On,disable,enable) $+ ]:jp_addicts
..'!jackpot winners' is $IIF(%jackpot.winners == On,ON,OFF) [click to $IIF(%jackpot.winners == On,disable,enable) $+ ]:jp_winners
..'!jackpot netwinners' is $IIF(%jackpot.netwinners == On,ON,OFF) [click to $IIF(%jackpot.netwinners == On,disable,enable) $+ ]:jp_netwinners
.WINNING SOUND EFFECT
..MP3 FILE $chr(91) $+ $IIF(%jackpot.sound,$remove($gettok(%jackpot.sound,$numtok(%jackpot.sound,47),47),$chr(34)),OFF) $+ $chr(93) [click to change]:jp_sound
..ONLY PLAY SOUND WHEN STREAM IS LIVE IS $IIF(%jackpot.sound_livecheck == On,ON,OFF) [click to $IIF(%jackpot.sound_livecheck == On,disable,enable) $+ ]:jp_sound_livecheck
..CLICK HERE TO TEST SOUND FILE:SPLAY -pq %jackpot.sound
.COST $chr(91) $+ %jackpot.bet %curname $+ $chr(93):jp_cost
.COOLDOWN $chr(91) $+ %jackpot.cd seconds $+ $chr(93):jp_cooldown
.FRESH POT $chr(91) $+ %jackpot.newpot %curname $+ $chr(93):jp_newpot
.ODDS OF WINNING $chr(91) $+ %jackpot.odds $+ $chr(37) $+ $chr(93):jp_odds
.CURRENT POT $chr(91) $+ $readini(jackpot.ini,@Stats,Jackpot) %curname $+ $chr(93):jp_currentpot
.WHISPER MODE is $IIF(%jackpot.whispers == On,ON,OFF) [click to $IIF(%jackpot.whispers == On,disable,enable) $+ ]:jp_whispers
.Click Here to Visit Online Documentation:URL -m https://github.com/Blasman/mIRC-Twitch-Scripts/wiki/Script-Documentation#jackpot-version-21
}
alias -l _jackpot_emote_menu {
IF ($1 == begin) { RETURN - }
IF ($1 == end) { RETURN - }
IF ($gettok(%jackpot.emotes,$1,32)) { RETURN $style(2) $ifmatch : $ifmatch }
}
alias -l jp_switch {
IF (!%GAMES_JACKPOT_ACTIVE) {
SET %GAMES_JACKPOT_ACTIVE On
MSG %mychan !jackpot is now enabled! Have fun! PogChamp
}
ELSE {
UNSET %GAMES_JACKPOT_ACTIVE
MSG %mychan !jackpot is now disabled.
}
}
alias -l jp_cost {
:cost
$input(How much %curname will it cost to play !jackpot?,eof,Required Input,%jackpot.bet)
IF ($! isnum) SET %jackpot.bet $floor($!)
ELSEIF ($! == $false) return
ELSE { ECHO You need to input a numerical value for the cost to play !jackpot! | GOTO cost }
}
alias -l jp_cooldown {
:cooldown
$input(What will be the cooldown in seconds per user for !jackpot?,eof,Required Input,%jackpot.cd)
IF ($! isnum) SET %jackpot.cd $floor($!)
ELSEIF ($! == $false) return
ELSE { ECHO You need to input a numerical value for the per-user cooldown on !jackpot! | GOTO cooldown }
}
alias -l jp_emotes {
:emotes
$input(Input at LEAST two emotes that you would like to use for !jackpot separated by spaces:,eof,Required Input,%jackpot.emotes)
IF ($!) {
VAR %emotes $!
IF ($numtok(%emotes,32) < 2) GOTO emotes
SET %jackpot.emotes %emotes
}
ELSEIF ($! == $false) return
ELSE { ECHO You need to input at least two emotes for !jackpot! | GOTO emotes }
}
alias -l jp_newpot {
:startamount
$input(What will be the staring amount of %curname for !jackpot?,eof,Required Input,%jackpot.newpot)
IF ($! isnum) {
SET %jackpot.newpot $floor($!)
IF (!$readini(jackpot.ini,@Stats,Jackpot)) WRITEINI jackpot.ini @Stats Jackpot %jackpot.newpot
}
ELSEIF ($! == $false) return
ELSE { ECHO You need to input a numerical value for the starting amount on !jackpot! | GOTO startamount }
}
alias -l jp_odds {
:odds
$input(What will be the percentage odds of winning !jackpot? $chr(40) $+ up to three decimal places $+ $chr(41),eof,Required Input,%jackpot.odds)
IF ($remove($!,$chr(37)) isnum) SET %jackpot.odds $round($!,3)
ELSEIF ($! == $false) return
ELSE { ECHO You need to input a numerical value for the odds of winning on !jackpot! | GOTO odds }
}
alias -l jp_currentpot {
:currentpot
$input(Enter the CURRENT $chr(40) $+ NOT the starting $+ $chr(41) pot for !jackpot,eof,Required Input,$readini(jackpot.ini,@Stats,Jackpot))
IF ($! isnum) WRITEINI jackpot.ini @Stats Jackpot $floor($!)
ELSEIF ($! == $false) return
ELSE { ECHO You need to input a numerical value for the current pot on !jackpot! | GOTO currentpot }
}
alias -l jp_whispers {
IF (%jackpot.whispers == Off) SET %jackpot.whispers On
ELSE SET %jackpot.whispers Off
}
alias -l jp_sound_livecheck {
IF (%jackpot.sound_livecheck == Off) SET %jackpot.sound_livecheck On
ELSE SET %jackpot.sound_livecheck Off
}
alias -l jp_myjackpot {
IF (%jackpot.myjackpot == Off) SET %jackpot.myjackpot On
ELSE SET %jackpot.myjackpot Off
}
alias -l jp_myjackpot_whispers {
IF (%jackpot.myjackpot_whispers == Off) SET %jackpot.myjackpot_whispers On
ELSE SET %jackpot.myjackpot_whispers Off
}
alias -l jp_stats {
IF (%jackpot.stats == Off) SET %jackpot.stats On
ELSE SET %jackpot.stats Off
}
alias -l jp_record {
IF (%jackpot.record == Off) SET %jackpot.record On
ELSE SET %jackpot.record Off
}
alias -l jp_addicts {
IF (%jackpot.addicts == Off) SET %jackpot.addicts On
ELSE SET %jackpot.addicts Off
}
alias -l jp_winners {
IF (%jackpot.winners == Off) SET %jackpot.winners On
ELSE SET %jackpot.winners Off
}
alias -l jp_netwinners {
IF (%jackpot.netwinners == Off) SET %jackpot.netwinners On
ELSE SET %jackpot.netwinners Off
}
alias jp_losemsg {
$input(Enter the LOSING message $chr(40) $+ if any $+ $chr(41) that will appear on the third reel. Use the word "user" $chr(40) $+ without qutoes $+ $chr(41) where you want the users name to be displayed:,eof,Required Input,%jackpot.lose_msg)
IF ($! == $false) return
ELSE SET %jackpot.lose_msg $!
}
alias jp_pullmsg {
$input(Enter the message that will appear when pulling the jackpot lever. Use the word "user" $chr(40) $+ without qutoes $+ $chr(41) where you want the users name to be displayed and the word "jptotal" $chr(40) $+ without qutoes $+ $chr(41) where you want the current jackpot total to be displayed:,eof,Required Input,%jackpot.pull_msg)
IF ($! == $false) return
ELSE SET %jackpot.pull_msg $!
}
alias jp_reelspeed_1 {
:reelspeed
$input(Enter the number of seconds that the first jackpot reel will appear after the lever pull message:,eof,Required Input,%jackpot.reel_1_speed)
IF ($regex($!,^\d+$)) SET %jackpot.reel_1_speed $!
ELSEIF ($! == $false) return
ELSE { ECHO You need to use a positive whole number. | GOTO reelspeed }
}
alias jp_reelspeed_2 {
:reelspeed
$input(Enter the number of seconds that the second jackpot reel will appear after the lever pull message:,eof,Required Input,%jackpot.reel_2_speed)
IF ($regex($!,^\d+$)) SET %jackpot.reel_2_speed $!
ELSEIF ($! == $false) return
ELSE { ECHO You need to use a positive whole number. | GOTO reelspeed }
}
alias jp_reelspeed_3a {
:reelspeed
$input(Enter the number of seconds that the third losing jackpot reel will appear after the lever pull message when the first two reels are NOT identical:,eof,Required Input,%jackpot.reel_3a_speed)
IF ($regex($!,^\d+$)) SET %jackpot.reel_3a_speed $!
ELSEIF ($! == $false) return
ELSE { ECHO You need to use a positive whole number. | GOTO reelspeed }
}
alias jp_reelspeed_3b {
:reelspeed
$input(Enter the number of seconds that the third losing jackpot reel will appear after the lever pull message when the first two reels ARE identical:,eof,Required Input,%jackpot.reel_3b_speed)
IF ($regex($!,^\d+$)) SET %jackpot.reel_3b_speed $!
ELSEIF ($! == $false) return
ELSE { ECHO You need to use a positive whole number. | GOTO reelspeed }
}
alias jp_reelspeed_3c {
:reelspeed
$input(Enter the number of seconds that the third WINNING jackpot reel will appear after the lever pull message:,eof,Required Input,%jackpot.reel_3c_speed)
IF ($regex($!,^\d+$)) SET %jackpot.reel_3c_speed $!
ELSEIF ($! == $false) return
ELSE { ECHO You need to use a positive whole number. | GOTO reelspeed }
}
alias jp_sound {
:sound
$input(Enter the path and filename to the MP3 file that you wish to use when a user wins the jackpot:,eof,Required Input,$noqt(%jackpot.sound))
IF ($right($!,4) == .mp3) {
IF ($isfile($qt($!))) SET %jackpot.sound $qt($!)
ELSE { ECHO File not found! Please check that the path and filename are correct! | GOTO sound }
}
ELSEIF (!$!) UNSET %jackpot.sound
ELSEIF ($! == $false) return
ELSE { ECHO You need to specify an .MP3 file for the jackpot win sound! | GOTO sound }
}
ON $*:TEXT:/^!jackpot\s(on|off|set|bet|cd|newpot|odds|emotes|emotelist|whispers|setup)/iS:%mychan: {
IF ($ModCheck) {
IF ($2 == on) {
IF (!%GAMES_JACKPOT_ACTIVE) {
SET %GAMES_JACKPOT_ACTIVE On
MSG $chan $nick $+ , !jackpot is now enabled! Have fun! PogChamp
}
ELSE MSG $chan $nick $+ , !jackpot is already enabled. FailFish
}
ELSEIF ($2 == off) {
IF (%GAMES_JACKPOT_ACTIVE) {
UNSET %GAMES_JACKPOT_ACTIVE
MSG $chan $nick $+ , !jackpot is now disabled.
}
ELSE MSG $chan $nick $+ , !jackpot is already disabled. FailFish
}
ELSEIF (($2 == set) && ($3 isnum)) {
SET %jackpot_pot $floor($3)
MSG $chan The !jackpot has been manually set to %jackpot_pot %curname $+ !
}
ELSEIF (($2 == bet) && ($3 isnum)) {
SET %jackpot.bet $floor($3)
MSG $chan The amount of %curname to play !jackpot has been changed to %jackpot.bet $+ !
}
ELSEIF (($2 == cd) && ($3 isnum)) {
SET %jackpot.cd $floor($3)
MSG $chan The cooldown time for !jackpot has been changed to %jackpot.cd seconds!
}
ELSEIF (($2 == newpot) && ($3 isnum)) {
SET %jackpot.newpot $floor($3)
MSG $chan The starting !jackpot amount has been set to %jackpot.newpot $+ !
}
ELSEIF (($2 == odds) && ($3 isnum)) {
SET %jackpot.odds $round($3,3)
MSG $chan The odds of winning !jackpot have been set to %jackpot.odds $+ $chr(37) $+ .
}
ELSEIF (($2 == whispers) && ($3)) {
IF ($3 == on) {
IF (%jackpot.whispers == OFF) {
SET %jackpot.whispers ON
MSG $chan $nick $+ , !jackpot will now be played through whispers.
}
ELSE MSG $chan $nick $+ , !jackpot is already being played through whispers. FailFish
}
ELSEIF ($3 == off) {
IF (%jackpot.whispers == ON) {
SET %jackpot.whispers OFF
MSG $chan $nick $+ , !jackpot will now be played in the channel chat.
}
ELSE MSG $chan $nick $+ , !jackpot is already being played in the channel chat. FailFish
}
}
ELSEIF ($2 == emotes) {
IF ($4) {
SET %jackpot.emotes $3-
MSG $chan The $numtok(%jackpot.emotes,32) !jackpot emotes have been set to %jackpot.emotes
}
ELSE MSG $chan $nick $+ , you need to specify at least two emotes for the !jackpot.
}
ELSEIF ($2 == emotelist) MSG $chan Jackpot Emote List: %jackpot.emotes
}
ELSEIF (($nick == %streamer) && ($2 == setup)) jackpot_setup
}
ON $*:TEXT:/^!jackpot(\s)?stats$/iS:%mychan: {
IF ((%jackpot.stats == On) && (!%CD_JACKPOT_STATS)) {
SET -eu10 %CD_JACKPOT_STATS On
IF (!$readini(jackpot.ini,@Stats,Last_Winner)) MSG $chan Current !jackpot: $bytes($readini(jackpot.ini,@Stats,Jackpot),b) %curname $+ . Nobody has won a !jackpot yet!
ELSE MSG $chan Current !jackpot: $bytes($readini(jackpot.ini,@Stats,Jackpot),b) %curname $+ . ▌ Last Winner was $readini(jackpot.ini,@Stats,Last_Winner) who won $bytes($readini(jackpot.ini,@Stats,Last_Jackpot),b) %curname on $readini(jackpot.ini,@Stats,Last_Winner_Time) $+ . ▌ Total Games Played: $jackpot_totalgames by $jackpot_uniqueplayers different players. ▌ Number of Wins: $bytes($readini(jackpot.ini,@Stats,Total_Winners),b) ▌ Total Payouts: $bytes($readini(jackpot.ini,@Stats,Total_Winnings),b) %curname $+ .
}
}
alias jackpot_totalgames {
VAR %x 1, %y 0
WHILE $ini(jackpot.ini,%x) {
VAR %y $calc($readini(jackpot.ini,$v1,Games) + %y)
INC %x
}
RETURN $bytes(%y,b)
}
alias jackpot_uniqueplayers {
VAR %x 1
WHILE ($ini(jackpot.ini,%x)) INC %x
RETURN $bytes($calc(%x - 1),b)
}
ON $*:TEXT:/^!jackpot(\s)?record$/iS:%mychan: {
IF ((%jackpot.record == On) && (!%CD_JACKPOT_RECORD)) {
SET -eu10 %CD_JACKPOT_RECORD On
IF (!$readini(jackpot.ini,@Stats,Record_Name)) MSG $chan Nobody has won a !jackpot yet!
ELSE MSG $chan The largest !jackpot ever won was for $bytes($readini(jackpot.ini,@Stats,Record_Amount),b) %curname by $readini(jackpot.ini,@Stats,Record_Name) on $readini(jackpot.ini,@Stats,Record_Date) $+ . PogChamp
}
}
ON $*:TEXT:/^!myjackpot(\s@?\w+)?$/iS:%mychan: {
IF (%jackpot.myjackpot == On) {
IF ($ModCheck) {
VAR %user $IIF($2,$remove($2,@),$nick)
IF ($ini(jackpot.ini,%user) != $null) {
MSG $IIF(%jackpot.myjackpot_whispers == On,$nick,$chan) Jackpot Stats for $twitch_name(%user) ▌ Games Played: $bytes($readini(jackpot.ini,%user,Games),b) ▌ Wins: $bytes($readini(jackpot.ini,%user,Wins),b) ▌ Winnings: $bytes($readini(jackpot.ini,%user,Winnings),b) ▌ Losses: $bytes($readini(jackpot.ini,%user,Losses),b) ▌ Net Winnings: $bytes($calc($readini(jackpot.ini,%user,Winnings) - $readini(jackpot.ini,%user,Losses)),b)
}
ELSE MSG $IIF(%jackpot.myjackpot_whispers == On,$nick,$chan) %user has never played a game of !jackpot!
}
ELSEIF ((!$($+(%,myjackpot_CD.,$nick),2)) && (!$2)) {
SET -eu30 %myjackpot_CD. $+ $nick On
IF ($ini(jackpot.ini,$nick) != $null) {
MSG $IIF(%jackpot.myjackpot_whispers == On,$nick,$chan) Jackpot Stats for $nick ▌ Games Played: $bytes($readini(jackpot.ini,$nick,Games),b) ▌ Wins: $bytes($readini(jackpot.ini,$nick,Wins),b) ▌ Winnings: $bytes($readini(jackpot.ini,$nick,Winnings),b) ▌ Losses: $bytes($readini(jackpot.ini,$nick,Losses),b) ▌ Net Winnings: $bytes($calc($readini(jackpot.ini,$nick,Winnings) - $readini(jackpot.ini,$nick,Losses)),b)
}
ELSE MSG $IIF(%jackpot.myjackpot_whispers == On,$nick,$chan) $nick $+ , you've never played !jackpot!
}
}
}
ON $*:TEXT:/^!jackpot(\s)?addicts$/iS:%mychan: {
IF ((%jackpot.addicts == On) && (!%CD_jackpotaddicts)) {
SET -eu10 %CD_jackpotaddicts On
window -h @. | var %i 1
WHILE $ini(jackpot.ini,%i) {
aline @. $v1 $readini(jackpot.ini,$v1,Games)
INC %i
}
filter -cetuww 2 32 @. @.
VAR %i 1 | while %i <= 10 {
tokenize 32 $line(@.,%i)
VAR %name $chr(35) $+ %i $1 $chr(40) $+ $2 $+ $chr(41) -
VAR %list $addtok(%list, %name, 32)
INC %i
}
MSG $chan Most !Jackpot Games Played: $left(%list, -1)
WINDOW -c @.
}
}
ON $*:TEXT:/^!jackpot(\s)?winners$/iS:%mychan: {
IF ((%jackpot.winners == On) && (!%CD_jackpotwinners)) {
SET -eu10 %CD_jackpotwinners On
window -h @. | var %i 1
WHILE $ini(jackpot.ini,%i) {
aline @. $v1 $readini(jackpot.ini,$v1,Winnings)
INC %i
}
filter -cetuww 2 32 @. @.
VAR %i 1 | while %i <= 10 {
tokenize 32 $line(@.,%i)
VAR %name $chr(35) $+ %i $1 $chr(40) $+ $bytes($2,b) $+ $chr(41) -
VAR %list $addtok(%list, %name, 32)
INC %i
}
MSG $chan !Jackpot's Biggest Winners: $left(%list, -1)
WINDOW -c @.
}
}
ON $*:TEXT:/^!jackpot(\s)?netwinners$/iS:%mychan: {
IF ((%jackpot.netwinners == On) && (!%CD_jackpotnetwinners)) {
SET -eu10 %CD_jackpotnetwinners On
window -h @. | var %i 1
WHILE $ini(jackpot.ini,%i) {
VAR %nick $v1
aline @. %nick $calc($readini(jackpot.ini,%nick,Winnings) - $readini(jackpot.ini,%nick,Losses))
INC %i
}
filter -cetuww 2 32 @. @.
VAR %i 1 | while %i <= 10 {
tokenize 32 $line(@.,%i)
VAR %name $chr(35) $+ %i $1 $chr(40) $+ $bytes($2,b) $+ $chr(41) -
VAR %list $addtok(%list, %name, 32)
INC %i
}
MSG $chan !Jackpot's Biggest NET Winners: $left(%list, -1)
WINDOW -c @.
}
}
ON $*:TEXT:/^!jackpot$/iS:%mychan: {
IF ((%ActiveGame == $nick $+ .jackpot) || ($istok(%queue, $nick $+ .jackpot,32))) halt
ELSEIF (!%GAMES_JACKPOT_ACTIVE) {
IF ((%CD_JACKPOT_ACTIVE) || ($($+(%,CD_JACKPOT_ACTIVE.,$nick),2))) halt
SET -eu10 %CD_JACKPOT_ACTIVE On
SET -eu120 %CD_JACKPOT_ACTIVE. $+ $nick On
MSG $chan $nick $+ , the !jackpot game is currently disabled.
}
ELSEIF ($timer(.JACKPOT. $+ $nick)) {
IF ($($+(%,CD_JACKPOT_CD.,$nick),2)) halt
SET -eu180 %CD_JACKPOT_CD. $+ $nick On
MSG $nick Be patient, $nick $+ ! You still have $duration($timer(.JACKPOT. $+ $nick).secs) left in your !jackpot cooldown.
}
ELSEIF ($GetPoints < %jackpot.bet) {
IF ($($+(%,CD_JACKPOT_CHECKPOINTS.,$nick),2)) halt
SET -eu10 %CD_JACKPOT_CHECKPOINTS. $+ $nick On
MSG $chan $nick $+ , you do not have $bytes(%jackpot.bet,b) %curname to play !jackpot FailFish
}
ELSE {
REMOVEPOINTS $nick %jackpot.bet
IF (%ActiveGame) SET %queue %queue $nick $+ .jackpot
ELSE play_jackpot $nick
}
}
alias play_jackpot {
; PLAY THE JACKPOT AND GENERATE REELS
SET %ActiveGame $1 $+ .jackpot
.timer.JACKPOT. $+ $1 1 %jackpot.cd MSG $1 $1 $+ , your !jackpot cooldown has expired. Feel free to play again. BloodTrail
WRITEINI jackpot.ini @Stats Jackpot $calc($readini(jackpot.ini,@Stats,Jackpot) + %jackpot.bet)
WRITEINI jackpot.ini $1 Games $calc($readini(jackpot.ini,$1,Games) + 1)
WRITEINI jackpot.ini $1 Losses $calc($readini(jackpot.ini,$1,Losses) + %jackpot.bet)
IF ($readini(jackpot.ini,$1,Wins) == $null) WRITEINI jackpot.ini $1 Wins 0
IF ($readini(jackpot.ini,$1,Winnings) == $null) WRITEINI jackpot.ini $1 Winnings 0
IF (%jackpot.whispers == OFF) {
MSG $1 $1 $+ , you spent %jackpot.bet %curname on !jackpot.
MSG %mychan $replace($replace(%jackpot.pull_msg,user,$1),jptotal,$bytes($readini(jackpot.ini,@Stats,Jackpot),b) %curname)
}
ELSE MSG $1 $1 $+ , you spent %jackpot.bet %curname on !jackpot. [Current Jackpot: $bytes($readini(jackpot.ini,@Stats,Jackpot),b) %curname $+ ]
VAR %jackpot.num.emotes = $numtok(%jackpot.emotes,32)
IF ($rand(1,100000) isnum 1 - $calc(%jackpot.odds * 1000)) {
VAR %jackpot $bytes($readini(jackpot.ini,@Stats,Jackpot),b)
VAR %x = $rand(1,%jackpot.num.emotes)
VAR %reel.1 $gettok(%jackpot.emotes,%x,32)
VAR %reel.2 $gettok(%jackpot.emotes,%x,32)
VAR %reel.3 $gettok(%jackpot.emotes,%x,32)
.timer.jackpot_01 1 %jackpot.reel_1_speed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌
.timer.jackpot_02 1 %jackpot.reel_2_speed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌ %reel.2 ▌
.timer.jackpot_03 1 %jackpot.reel_3c_speed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌ %reel.2 ▌ %reel.3 ▌ ::: You Won %jackpot %curname $+ , $1 $+ ! Congratulations! PogChamp
IF ((%jackpot.sound) && (((%jackpot.sound_livecheck == On) && ($livecheck(%streamer))) || (%jackpot.sound_livecheck == Off))) .timer.jackpot_04 1 %jackpot.reel_3c_speed SPLAY -pq %jackpot.sound
.timer.jackpotwinner1 1 $calc(%jackpot.reel_3c_speed +1) MSG %mychan KAPOW KAPOW KAPOW OMG!!! JACKPOT!!! $1 just won %jackpot %curname $+ !!! KAPOW KAPOW KAPOW
.timer.jackpotwinner2 1 $calc(%jackpot.reel_3c_speed +2) MSG %mychan KAPOW KAPOW KAPOW OMG!!! JACKPOT!!! $1 just won %jackpot %curname $+ !!! KAPOW KAPOW KAPOW
.timer.jackpotwinner3 1 $calc(%jackpot.reel_3c_speed +3) MSG %mychan KAPOW KAPOW KAPOW OMG!!! JACKPOT!!! $1 just won %jackpot %curname $+ !!! KAPOW KAPOW KAPOW
.timer.jackpotwinner4 1 $calc(%jackpot.reel_3c_speed +3) jackpotwinner $1
}
ELSE {
VAR %x = 1
WHILE (%x <= 3) {
; FIRST REEL, OR THIRD REEL IF FIRST TWO REELS ARE NOT IDENTICAL
IF ((%x == 1) || ((%x == 3) && (%reel.1 != %reel.2))) {
IF (%x == 3) VAR %reelspeed = %jackpot.reel_3a_speed
VAR %first.reel.num $rand(1,$numtok(%jackpot.emotes,32))
VAR %reel. [ $+ [ %x ] ] $gettok(%jackpot.emotes,%first.reel.num,32)
INC %x
}
; SECOND REEL, INCREASE ODDS OF REPEATING THE FIRST REEL
ELSEIF (%x == 2) {
VAR %new.num.emotes = $round($calc(%jackpot.num.emotes * 1.44),0)
VAR %d = $rand(1,%new.num.emotes)
IF (%d isnum 1 - $round($calc(%jackpot.num.emotes * 1.44 - %jackpot.num.emotes + 1),0)) VAR %reel.2 %reel.1
ELSE {
:secondreel
VAR %e = $calc(%new.num.emotes - %jackpot.num.emotes + 1)
VAR %f = 1
WHILE (%e <= %new.num.emotes) {
IF (%e == %d) {
IF (%f == %first.reel.num) {
VAR %d = $rand($calc(%new.num.emotes - %jackpot.num.emotes + 1),%new.num.emotes)
GOTO secondreel
}
ELSE {
VAR %reel.2 $gettok(%jackpot.emotes,%f,32)
BREAK
}
}
INC %e
INC %f
}
}
INC %x
}
; THIRD LOSING REEL IF FIRST TWO REELS ARE THE SAME
ELSE {
VAR %reelspeed = %jackpot.reel_3b_speed
:finalreel
VAR %h = $rand(1,%jackpot.num.emotes)
VAR %i = 1
WHILE (%i <= %jackpot.num.emotes) {
IF (%h == %i) {
IF (%i == %first.reel.num) GOTO finalreel
ELSE {
VAR %reel.3 $gettok(%jackpot.emotes,%i,32)
BREAK
}
}
INC %i
}
INC %x
}
}
.timer.jackpot_01 1 %jackpot.reel_1_speed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌
.timer.jackpot_02 1 %jackpot.reel_2_speed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌ %reel.2 ▌
.timer.jackpot_03 1 %reelspeed $IIF(%jackpot.whispers == OFF,DESCRIBE %mychan,MSG $1) ▌ %reel.1 ▌ %reel.2 ▌ %reel.3 ▌ $replace(%jackpot.lose_msg,user,$1)
.timer.jackpot_04 1 %reelspeed end_game
}
}
alias jackpotwinner {
ADDPOINTS $1 $readini(jackpot.ini,@Stats,Jackpot)
IF (($readini(jackpot.ini,@Stats,Jackpot) > $readini(jackpot.ini,@Stats,Record_Amount)) || (!$readini(jackpot.ini,@Stats,Record_Amount))) {
WRITEINI jackpot.ini @Stats Record_Name $1
WRITEINI jackpot.ini @Stats Record_Amount $readini(jackpot.ini,@Stats,Jackpot)
WRITEINI jackpot.ini @Stats Record_Date $asctime(mmm d h:nn TT) EST
}
WRITEINI jackpot.ini @Stats Last_Jackpot $readini(jackpot.ini,@Stats,Jackpot)
WRITEINI jackpot.ini @Stats Last_Winner $1
WRITEINI jackpot.ini @Stats Last_Winner_Time $asctime(mmm d h:nn TT) EST
WRITEINI jackpot.ini @Stats Total_Winners $calc($readini(jackpot.ini,@Stats,Total_Winners) + 1)
WRITEINI jackpot.ini @Stats Total_Winnings $calc($readini(jackpot.ini,@Stats,Total_Winnings) + $readini(jackpot.ini,@Stats,Jackpot))
WRITEINI jackpot.ini $1 Wins $calc($readini(jackpot.ini,$1,Wins) + 1)
WRITEINI jackpot.ini $1 Winnings $calc($readini(jackpot.ini,$1,Winnings) + $readini(jackpot.ini,@Stats,Jackpot))
WRITEINI jackpot.ini @Stats Jackpot %jackpot.newpot
end_game
}