-
Notifications
You must be signed in to change notification settings - Fork 15
/
predict.mrc
180 lines (176 loc) · 11 KB
/
predict.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
ON *:TEXT:!predict*:%mychan: {
IF ($2 == help) || ($2 == $null) {
IF (%floodPREDICTHELP) halt
SET -u20 %floodPREDICTHELP On
MSG $chan The !predict game is simple. It costs no points to enter. You make a prediction of what percentage that the predict hack will end at. If your guess is closest to the final percentage of the hack, you will win points! If you get the percentage exactly correct (except for 100%), then you will win twice as many points! Points are split if there is a tie. Predict using !predict [percentage]
}
IF ($2 == types) {
IF (%floodPREDICTTYPES) halt
SET -u20 %floodPREDICTTYPES On
MSG $chan The different types of !predict hacks include: Firetruck (firetruck) ▌ immediate on foot (foot) ▌ "Stevie Wonder" (blind) ▌ Ice Cream or Taco Truck (icetaco) ▌ Ambulance (ambulance) ▌ hiding a car (carhide) ▌ standing at a bus stop (busstop) ▌ clothing store display case (display) ▌ store clerk (storeclerk) ▌ standing in an intersection (intersection)
}
IF (%predictsopen) {
IF ($2 isnum 1-100) && (%predict. [ $+ [ $nick ] ] == $null) {
VAR %nick $twitch_name($nick)
WRITE predict.txt %nick $floor($2)
SET %predict. [ $+ [ $nick ] ] On
IF ($2 isnum 1-99) MSG $nick %nick $+ , your prediction of $2 $+ % has been recorded. You will win %ppayout points if you predicted closest to the final percentage of the hack. You will win DOUBLE the points ( $+ $calc(%ppayout * 2) $+ ) if you get the percentage exactly correct! Good luck! BloodTrail
IF ($2 isnum 100) MSG $nick %nick $+ , your prediction of $2 $+ % has been recorded. You will win %ppayout points if you predicted closest to the final percentage of the hack. Good luck! BloodTrail
}
}
IF ($nick isop $chan) {
IF ($2 == $chr(35)) {
IF ($isfile(predict.txt)) MSG $chan Total number of predicts: $lines(predict.txt)
ELSE MSG $chan There are no current predicts!
}
IF ($2 == firetruck) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! Blasman will attempt to win the next hack while staying in a Firetruck with the sirens on. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == foot) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! Blasman will attempt to win the next hack by beginning it asap, remaining on foot, and not hiding at the edge of the circle. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == blind) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! Blasman will attempt to win the next hack by remaining highly visable to the opponent. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == icetaco) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! The next time Blasman spots an ice cream truck or taco van, he will attempt to win the hack while driving in it. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == ambulance) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! Blasman will attempt to win the next hack while staying in an ambulance with the sirens on. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == carhide) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! Blasman will attempt to win the next hack while hiding in vehicle (not a bike). The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == busstop) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! The first chance that Blasman gets, he will start a hack while standing center circle at a bus stop. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == display) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! The first chance that Blasman gets, he will start a hack while standing center circle in a clothing store display case. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == storeclerk) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! The first chance that Blasman gets, he will start a hack while standing center circle and taking the place of a store clerk. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == intersection) && ($3 isnum) {
IF (%predictsopen) halt
SET %ppayout $floor($3)
SET %predictsopen On
MSG $chan PREDICT HACK!!! The first chance that Blasman gets, he will attempt to win a hack while standing in the middle of an intersection. The viewer with the closest guess to the percentage that the hack will end at will receive %ppayout points. Please predict now using the format !predict [percent] and BEFORE Blasman enters the players game.
}
IF ($2 == close) {
IF (%predictsopen) {
UNSET %predictsopen
MSG $chan Predicts are now CLOSED! Please enjoy the hacks and wait until the predict game is over to see if you are a winner! BloodTrail
}
}
IF ($2 == open) {
IF (!%predictsopen) {
SET %predictsopen On
MSG $chan Predictions for the current prediction hack have been re-opened! You have another chance to !predict if you have not already! FeelsGoodMan
}
}
IF ($2 == cancel) {
IF (%predictsopen) {
MSG $chan The !predict hack has been cancelled.
endpredict
}
}
IF ($2 == change) && ($3 isnum) {
IF (%predictsopen) {
VAR %newppayout $floor($3)
MSG $chan The current payout for the !predict hack has been changed from %ppayout to %newpppayout points!
SET %ppayout %newppayout
}
}
IF ($2 == end) && ($3 isnum 1-100) {
IF $exists(predict.txt) == $false { MSG $chan There are no predictions! | halt }
UNSET %predictsopen
VAR %finalpercent = $3
VAR %predict_count = 1
VAR %narrowpercent = 1
WHILE (%findwinner == $null) && (%exactwinner == $null) {
WHILE ($read(predict.txt, %predict_count) != $null) {
VAR %nick $wildtok($read(predict.txt, %predict_count), *, 1, 32)
VAR %predict $wildtok($read(predict.txt, %predict_count), *, 2, 32)
IF (%predict == %finalpercent) VAR %exactwinner $+(%exactwinner, $chr(32), %nick, $chr(32))
ELSEIF ($calc(%predict + %narrowpercent) == %finalpercent) || ($calc(%predict - %narrowpercent) == %finalpercent) {
VAR %findwinner $+(%findwinner, $chr(32), %nick, $chr(32))
VAR %findpercent $+(%findpercent, $chr(32), %predict, $chr(32))
}
INC %predict_count
}
VAR %predict_count = 1
INC %narrowpercent
}
VAR %countwinners = 1
IF (%exactwinner) {
VAR %numwinners = $numtok(%exactwinner,32)
IF (%finalpercent == 100) {
SET %ppayout $floor($calc(%ppayout / %numwinners))
WHILE (%numwinners >= %countwinners) {
VAR %winner $wildtok(%exactwinner, *, %countwinners, 32)
ADDPOINTS %winner %ppayout
INC %countwinners
}
IF (%numwinners == 1) MSG $chan Congrats, %winner $+ , for predicting that the hack would end at exactly %finalpercent $+ $chr(37) $+ ! You win %ppayout points! PogChamp
IF (%numwinners > 1) MSG $chan Congrats to the following people for predicting that the hack would end at exactly %finalpercent $+ $chr(37) $+ ! You all split the winnings at %ppayout points each! Winners: %exactwinner BloodTrail
}
IF (%finalpercent < 100) {
SET %ppayout $floor($calc(%ppayout * 2 / %numwinners))
WHILE (%numwinners >= %countwinners) {
VAR %winner $wildtok(%exactwinner, *, %countwinners, 32)
ADDPOINTS %winner %ppayout
INC %countwinners
}
IF (%numwinners == 1) MSG $chan Congrats, %winner $+ , for predicting that the hack would end at exactly %finalpercent $+ $chr(37) $+ ! You win %ppayout points! PogChamp
IF (%numwinners > 1) MSG $chan Congrats to the following people for predicting that the hack would end at exactly %finalpercent $+ $chr(37) $+ ! You all split the winnings at %ppayout points each! Winners: %exactwinner BloodTrail
}
}
ELSEIF (%findwinner) {
VAR %numwinners = $numtok(%findwinner,32)
SET %ppayout $floor($calc(%ppayout / %numwinners))
WHILE (%numwinners >= %countwinners) {
VAR %winner $wildtok(%findwinner, *, %countwinners, 32)
VAR %percent $wildtok(%findpercent, *, %countwinners, 32)
ADDPOINTS %winner %ppayout
INC %countwinners
}
IF (%numwinners == 1) MSG $chan Congrats, %winner $+ , for getting the closest prediction to %finalpercent $+ $chr(37) with your prediction of %percent $+ $chr(37) $+ ! You win %ppayout points! PogChamp
IF (%numwinners > 1) MSG $chan Congrats to the following people for making the closest predictions to %finalpercent $+ $chr(37) $+ ! You all split the winnings at %ppayout points each! Winners: %findwinner BloodTrail
}
endpredict
}
}
}
alias endpredict {
IF ($isfile(predict.txt)) REMOVE predict.txt
UNSET %predictsopen
UNSET %ppayout
UNSET %predict.*
}