RAW USERNOTICE:*: {
IF (($msgtags(room-id).key == 00000000) && ($istok(sub resub subgift submysterygift, $msgtags(msg-id).key, 32))) {
VAR %login $msgtags(login).key , %user_id $msgtags(user-id).key , %run_extras $true
IF ($regex($msgtags(display-name).key, /^[a-z\d_]+$/ig)) VAR %name $msgtags(display-name).key
ELSE VAR %name %login
IF ($msgtags(msg-id).key == submysterygift) {
VAR %type submysterygift , %num_of_subs $msgtags(msg-param-mass-gift-count).key , $+ %name %num_of_subs
INC %submysterygift. $+ %name %num_of_subs
MSG $1 @ $+ %name thank you for showering us with ice cubes! Nothing like a little hail!
}
ELSEIF ($msgtags(msg-id).key == sub) {
VAR %type sub
MSG $1 Welcome to the Ice Box, enjoy the brain freeze %name $+ !
}
ELSEIF ($msgtags(msg-id).key == resub) {
VAR %type resub , %resub_streak_msg $IIF($msgtags(msg-param-streak-months).key > 1 , $msgtags(msg-param-cumulative-months).key months?! Welcome back, %name $+ $char(44) you are on $msgtags(msg-param-streak-months).key month streak! , $msgtags(msg-param-cumulative-months).key months?! Welcome back, %name $+ ! )
MSG $1 Back for more? How do you not have frostbite after %resub_streak_msg
}
ELSEIF ($msgtags(msg-id).key == subgift) {
VAR %type subgift , %gifted_to $msgtags(msg-param-recipient-user-name).key , %gifted_to_display_name $msgtags(msg-param-recipient-display-name).key , %gifted_to_id $msgtags(msg-param-recipient-id).key
IF (!$($+(%,submysterygift.,%name),2)) {
VAR %resub_msg $IIF($msgtags(msg-param-months).key > 1, Freezing for $v1 months!, $null)
MSG $1 @ $+ %gifted_to_display_name $+ , welcome to the freezer! You have %name to thank. %resub_msg
}
ELSE {
VAR %run_extras $false
DEC %submysterygift. [ $+ [ %name ] ]
IF (!$($+(%,submysterygift.,%name),2)) UNSET %submysterygift. [ $+ [ %name ] ]
}
}
IF (%run_extras) {
; extra stuff to do whenever a sub, resub, single gifted sub, or mass sub gift happens (only runs once!)... in other words, this WON'T run for every individual sub during a mass sub gift!
}
}
}