Snippets Project Page
Author: entropy
Added: 5y
Updated: 5y
mIRC: 7.52+
Hits: 1,403
Downloads: 23
Review: entropy
Size: 1.38KB
1 0
Login to vote.
Age
v1.1
Returns how many days you have been alive. Neat little script.
Download
JSON
▲ Review
▼ Source
; !AGE v1.1 - by entropy 2018 #age on on *:text:*:#:{ doage $1- } on *:input:#:{ doage $1- } alias -l doage { if (?age iswm $1 && $left($1,1) isin @!.) { if (!$2 || / isin $2) { .timerage -o 1 1 msg # No Month Day Year! Syntax: !age <month> <day> <year> } elseif ($2 !isnum 1-12 || $3 !isnum 1-31 || $len($4) == 2) { .timerage -o 1 1 msg # Invalid age! } else { .timerage -o 1 1 age # $2-4 } } } alias -l age { sockclose age sockopen age www.datetime.io 80 sockmark age $1 %year = $4 %month = $2 %day = $3 } alias -l nohtml { return $regsubex($1, /<[^>]+(?:>|$)|^[^<>]+>/g,) } on *:sockopen:age:{ if ($sockerr) { echo AGE error! | return } sockwrite -n $sockname GET $+(http://www.datetime.io/age/,%year,/,%month,/,%day) HTTP/1.0 sockwrite -n $sockname Host: www.datetime.io sockwrite -n $sockname $crlf } on *:sockread:age:{ if ($sockerr) { echo AGE error! | return } var %a sockread -f $mid(%a,1,1000) tokenize 32 %a if (*<h2><span class="highlight">You are * iswm $1-) { msg $sock($sockname).mark [AGE] $chr(9679) $nohtml($1-) } if (*You were born on a * iswm $1-) { msg $sock($sockname).mark [AGE] $chr(9679) $1- } } on *:sockclose:age:{ unset %year %day %month } #age end
Changelog:
0
0