Snippets Project Page
Author: entropy
Added: 5y
Updated: 5y
mIRC: 7.52+
Hits: 922
Downloads: 19
Review: entropy
Size: 1.65KB
1 0
Login to vote.
Reminder
v1.3
syntax: !remind 1h23m
Reminds you in seepecified time to do something.
Download
JSON
▲ Review
▼ Source
; Reminder v1.3 - by entropy 2018 ; syntax: !remind 1h23m <text> #reminder on alias -l safe return $!decode( $encode($1-, m) ,m) alias -l gettime { var %a = 1, %b, %c = $replace($1,h,$+(h,$chr(1)),m,$+(m,$chr(1)),s,$+(s,$chr(1))), %secs = 0 while ($gettok(%c,%a,1)) { %b = $v1 if (h isin %b) { inc %secs $calc($remove(%b,h) * 60 * 60) } if (m isin %b) { inc %secs $calc($remove(%b,m) * 60) } if (s isin %b) { inc %secs $remove(%b,s) } inc %a } return %secs } on *:input:#:{ remind $1- } on *:text:*:#:{ remind $1- } alias -l remind { if (?remind iswm $1 && $left($1,1) isin @!.) { if ($2) { if (secs isin $2 || sec isin $2 || mins isin $2 || min isin $2 || hrs isin $2 || hours isin $2 || hour isin $2 || hr isin $2) { msg # Invalid time! Syntax: !remind $+($chr(2),1h23m10s,$chr(2)) <text> } elseif (w isin $2 || weeks isin $2 || d isin $2 || days isin $2 || y isin $2 || year isin $2 || years isin $2) { msg # You can only remind hours, mins and secs! } elseif ($2 isnum || $2 !isalnum) { msg # Invalid time! Syntax: !remind $+($chr(2),1h23m10s,$chr(2)) <text> } elseif ($gettime($2) < 60 || $gettime($2) > 86400) { msg # Invalid time! It must be between 1m and 24h! } elseif ($3) { msg # Reminder set for $2 $+ ... .timer -o 1 $gettime($2) msg # $nick $2 reminder: $safe($3-) } else { msg # No text specified! } } else { msg # No duration specified! } } } #reminder end
Changelog:
0
0