forked from Blasman/mIRC-Twitch-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rr.mrc
234 lines (212 loc) · 10.1 KB
/
rr.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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; VARIABLES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/*
HEY! LOOK HERE! This is what you need to change in this script...
Change the %rr_minbet and %rr_maxbet to the minimum and maximum
amount of points that must be spent in order to use !rr. The
%rr_cd variable is the per user cooldown time (in seconds) that a user
must wait before being able to use !rr again.
You will need to UNLOAD and RE-LOAD this script for any changes to the
variables below to take effect. This can be done by pressing ALT-R in
mIRC > Select "View" > Select "rr.mrc" > Click on "File" > "Unload."
Then, click on "File" and "Load..." and select the rr.mrc file again.
Have fun!!!
*/
ON *:LOAD: {
SET %rr_minbet 100
SET %rr_maxbet 1000
SET %rr_cd 300
}
ON *:UNLOAD: { UNSET %rr_* }
ON *:CONNECT: {
IF ($server == tmi.twitch.tv) {
UNSET %rr.*
UNSET %RR_CD.*
IF ($isfile(rrbets.txt)) REMOVE rrbets.txt
}
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;; RUSSIAN ROULETTE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ON $*:TEXT:/^!rr\s(on|off)$/iS:%mychan: {
IF ($nick isop $chan) {
IF ($2 == on) {
IF (!%GAMES_RR_ACTIVE) {
SET %GAMES_RR_ACTIVE On
MSG $chan $twitch_name($nick) $+ , the Russian Roulette game is now enabled! Type !rr for more info! Have fun! PogChamp
}
ELSE MSG $chan $twitch_name($nick) $+ , !rr is already enabled. FailFish
}
ELSEIF ($2 == off) {
IF (%GAMES_RR_ACTIVE) {
UNSET %GAMES_RR_ACTIVE
MSG $chan $twitch_name($nick) $+ , the Russian Roulette game is now disabled.
}
ELSE MSG $chan $twitch_name($nick) $+ , Russian Roulette is already disabled. FailFish
}
}
}
ON $*:TEXT:/^!rr(\s|$)/iS:%mychan: {
IF (($($+(%,floodRR.,$nick),2)) || (%rr.safeguard) || (%ActiveGame) || ($isfile(roulbets.txt))) halt
SET -u3 %floodRR. $+ $nick On
IF (!%GAMES_RR_ACTIVE) {
IF ((%floodRR_ACTIVE) || ($($+(%,floodRR_ACTIVE.,$nick),2))) halt
SET -u15 %floodRR_ACTIVE On
SET -u120 %floodRR_ACTIVE. $+ $nick On
MSG $chan $twitch_name($nick) $+ , the Russian Roulette game is currently disabled.
halt
}
ELSEIF (($2 isnum %rr_minbet - %rr_maxbet) && (!%rr.p1)) {
IF ($($+(%,RR_CD.,$nick),2)) MSG $nick $twitch_name($nick) $+ , please wait for your cooldown to expire in $duration(%RR_CD. [ $+ [ $nick ] ]) before trying to play Russian Roulette again.
ELSEIF ($checkpoints($nick, $2) == false) MSG $chan $twitch_name($nick) $+ , you don't have enough %curname to play. FailFish
ELSEIF (!$3) {
SET %rr.p1 $twitch_name($nick)
SET %rr.bet $floor($2)
MSG $chan KAPOW %rr.p1 has issued a Russian Roulette challenge for %rr.bet %curname to the first person to accept within 90 seconds! To accept this challenge type "!rr accept"
.timer.rr.wait1 1 90 MSG $chan Sorry, %rr.p1 $+ , but nobody wanted to accept your Russian Roulette challenge! FeelsBadMan
.timer.rr.wait2 1 90 UNSET %rr.*
.timer.rr.wait3 1 90 SET -z %RR_CD. $+ $nick %rr_cd
}
ELSEIF ($3) && ($3 != $me) {
VAR %target $remove($3, @)
IF (%target ison $chan) {
IF ($checkpoints(%target, $2) == false) MSG $chan $twitch_name($nick) $+ , $twitch_name(%target) doesn't have enough %curname to play. FailFish
ELSE {
SET %rr.p1 $twitch_name($nick)
SET %rr.p2 $twitch_name(%target)
SET %rr.bet $floor($2)
MSG $chan KAPOW %rr.p1 has issued a Russian Roulette challenge for %rr.bet %curname to %rr.p2 $+ ! %rr.p2 now has 90 seconds to accept this challenge by typing "!rr accept"
.timer.rr.wait1 1 90 MSG $chan Sorry, %rr.p1 $+ , but %rr.p2 didn't want to accept your Russian Roulette challenge! FeelsBadMan
.timer.rr.wait2 1 90 UNSET %rr.*
.timer.rr.wait3 1 90 SET -z %RR_CD. $+ $nick %rr_cd
}
}
ELSE MSG $chan $twitch_name($nick) $+ , $3 is not the name of a user here in the channel. Please check the spelling and make sure that they are actually here.
}
}
ELSEIF ((%rr.p1) && ($nick != %rr.p1) && ($2 == accept)) {
IF (!%rr.p2) {
IF ($checkpoints($nick, %rr.bet) == false) MSG $chan $twitch_name($nick) $+ , you don't have enough %curname to play. FailFish
ELSE SET %rr.p2 $twitch_name($nick)
}
IF (%rr.p2 == $nick) {
.timer.rr.wait* off
MSG $chan %rr.p2 has accepted the Russian Roulette challenge of %rr.p1 $+ ! Betting is now open for the next 90 seconds on who will be the survivor! To place bets, type !rrbet [user] $chr(91) $+ %rr_minbet $+ - $+ %rr_maxbet $+ $chr(93) ▌ Example: !rrbet %rr.p1 %rr_maxbet
SET %rr.safeguard On
SET %rr.openbets On
timer.rr.start 1 90 rrstart
}
}
ELSEIF (!%rr.p1) {
IF (%floodrrinfo) halt
SET -u10 %floodrrinfo On
MSG $chan Play Russian Roulette with a friend to try and win each others %curname $+ ! Just type "!rr $chr(91) $+ %rr_minbet $+ - $+ %rr_maxbet $+ $chr(93) $+ " to play against ANYONE, -or- type "!rr $chr(91) $+ %rr_minbet $+ - $+ %rr_maxbet $+ $chr(93) username" to play against a specific person! ▌ Example: !rr %rr_maxbet
}
}
ON $*:TEXT:/^!rrbet\s/iS:%mychan: {
IF ((%rr.openbets) && ($nick != %rr.p1) && ($nick != %rr.p2) && (!%rr.bet. [ $+ [ $nick ] ]) && (($2 == %rr.p1) || ($2 == %rr.p2)) && ($3 isnum %rr_minbet - %rr_maxbet)) {
IF ($checkpoints($nick, $floor($3)) == false) {
IF ($($+(%,floodRR_TOOPOOR.,$nick),2)) halt
SET -u10 %floodRR_TOOPOOR. $+ $nick On
MSG $chan $twitch_name($nick) $+ , you don't have enough %curname to make that bet! FailFish
}
ELSE {
VAR %nick $twitch_name($nick)
VAR %wager $floor($3)
REMOVEPOINTS $nick %wager
IF ($2 == %rr.p1) VAR %beton %rr.p1
ELSE VAR %beton %rr.p2
SET %rr.bet. [ $+ [ $nick ] ] On
WRITE rrbets.txt %nick %beton %wager
$wdelay(MSG $nick %nick $+ $chr(44) you have bet %wager %curname that %beton will be the survivor. Good luck! BloodTrail)
}
}
}
alias rrstart {
UNSET %rr.openbets
MSG %mychan It has begun! %rr.p1 loads one bullet, puts the cylinder inside the revolver, spins it around, and places the cold barrel of the gun to their temple and gets ready to take the shot... WutFace
VAR %chamber $rand(1,6)
IF (%chamber == 1) {
.timer.rr.msg01 1 11 MSG %mychan REKT! Well, that didn't last long at all! %rr.p1 lays lifeless on the ground, and %rr.p2 takes %rr.bet %curname from %rr.p1 $+ ! BrokeBack
SET %rr.winner %rr.p2
SET %rr.loser %rr.p1
.timer.rr.payout 1 13 rrpayout
}
ELSE {
.timer.rr.msg02 1 11 MSG %mychan *CLICK!* %rr.p1 survives the first round! %rr.p1 happily passes the gun to %rr.p2 $+ ... FeelsGoodMan
DEC %chamber
IF (( %chamber == 1 )) {
.timer.rr.msg03 1 22 MSG %mychan REKT! Well, that didn't last very long... %rr.p2 lays lifeless on the ground, and %rr.p1 removes %rr.bet %curname from %rr.p2 $+ ! BrokeBack
SET %rr.winner %rr.p1
SET %rr.loser %rr.p2
.timer.rr.payout 1 24 rrpayout
}
ELSE {
.timer.rr.msg04 1 22 MSG %mychan *CLICK!* %rr.p2 survives round two! %rr.p2 gladly hands the gun back to %rr.p1 $+ ... FeelsGoodMan
DEC %chamber
IF (( %chamber == 1 )) {
.timer.rr.msg05 1 33 MSG %mychan REKT! Game Over! %rr.p1 blew their brains out, and %rr.p2 takes %rr.bet %curname from the wasted body of %rr.p1 $+ ! BrokeBack
SET %rr.winner %rr.p2
SET %rr.loser %rr.p1
.timer.rr.payout 1 35 rrpayout
}
ELSE {
.timer.rr.msg06 1 33 MSG %mychan *CLICK!* %rr.p1 lives through round three! %rr.p1 willingly passes the gun back to %rr.p2 $+ ! PogChamp
DEC %chamber
IF (( %chamber == 1 )) {
.timer.rr.msg07 1 44 MSG %mychan %rr.p2 got REKT! %rr.p1 removes %rr.bet %curname from the dead body of %rr.p2 $+ ! BrokeBack
SET %rr.winner %rr.p1
SET %rr.loser %rr.p2
.timer.rr.payout 1 46 rrpayout
}
ELSE {
.timer.rr.msg08 1 44 MSG %mychan *CLICK!* Wow! %rr.p2 has survived the fourth round! %rr.p2 breathes a sigh of relief and passes the gun back to %rr.p1 $+ ... PogChamp
DEC %chamber
IF (( %chamber == 1 )) {
.timer.rr.msg09 1 55 MSG %mychan REKT! %rr.p1 could not survive round five... %rr.p2 takes %rr.bet %curname from the lifeless body of %rr.p1 $+ ... BrokeBack
SET %rr.winner %rr.p2
SET %rr.loser %rr.p1
.timer.rr.payout 1 57 rrpayout
}
ELSE {
.timer.rr.msg10 1 55 MSG %mychan *CLICK!* OMG! %rr.p1 lives through round five! With a maniacal smile, %rr.p1 laughs and hands the gun back to %rr.p2 $+ ... :tf:
DEC %chamber
IF (( %chamber == 1 )) {
.timer.rr.msg11 1 66 MSG %mychan REKT! There was no surviving the final round for %rr.p2 $+ ... %rr.p1 removes %rr.bet %curname from the corpse of %rr.p2 $+ .
SET %rr.winner %rr.p1
SET %rr.loser %rr.p2
.timer.rr.payout 1 68 rrpayout
}
}
}
}
}
}
}
alias rrpayout {
REMOVEPOINTS %rr.loser %rr.bet
ADDPOINTS %rr.winner %rr.bet
IF ($isfile(rrbets.txt)) {
VAR %x = 1
WHILE ($read(rrbets.txt, %x) != $null) {
VAR %nick $wildtok($read(rrbets.txt, %x), *, 1, 32)
VAR %winlose $wildtok($read(rrbets.txt, %x), *, 2, 32)
VAR %amount $wildtok($read(rrbets.txt, %x), *, 3, 32)
IF (%winlose == %rr.winner) {
VAR %winnings = %amount * 2
VAR %winnersList %winnersList %nick $chr(40) $+ %winnings $+ $chr(41) -
ADDPOINTS %nick %winnings
}
INC %x
}
IF (%winnersList) {
VAR %winnersList $left(%winnersList, -1) BloodTrail
.timer.endroul 1 3 MSG %mychan Congratulations to everyone who bet on %rr.winner $+ : %winnersList
}
ELSE MSG %mychan Nobody bet on %rr.winner $+ ! Better luck next time! :tf:
REMOVE rrbets.txt
}
SET -z %RR_CD. $+ %rr.p1 %rr_cd
UNSET %rr.*
}