Finds the "cyborg" name for a given nick.
Type /cyborg <nick/name> in any window. It'll message the name to the channel, or echo if you type it in status.
Example /cyborg Jagfire returns J.A.G.F.I.R.E.: Journeying Android Generated for Forbidden Infiltration and Rational Exploration
alias cyborg {
if ($remove($len($1),$chr(32)) isnum 2-10) {
set %supchan $active
set %cy.name $remove($1,!,@,#,$,%,^,&,*,-,+,_,=,[,],;,:,',",<,>,.,,/,|)
sockopen cy cyborg.namedecoder.com 80
}
else echo -at Use /cyborg <name> (must be between 2-10 letters)
}
on *:sockread:cy:{
if ($sockerr) {
echo -a Error.
halt
}
else {
var %'
sockread %'
if (*<p class="mediumheader">*.*.*</p>* iswm %') {
if (%supchan ischan) { msg %supchan $z(%') | unset %supchan }
else echo -a $z(%')
sockclose cy
unset %cy.name
halt
}
}
}
alias -l z {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,$chr(9))
return %x
}
on *:sockopen:cy:{
sockwrite -n $sockname GET /index.php?acronym= $+ %cy.name $+ &design=edox&design_click-edox.x=41&design_click-edox.y=78 HTTP/1.1
sockwrite -n $sockname Host: cyborg.namedecoder.com $+ $crlf $+ $crlf
}
I tacked on the last $len check of < 11 at the end just before submitting this, so I didn\'t make the most efficient way possible. Also, I don\'t bother with a wildcard when unsetting variables unless there are more than 2. Just a rule of thumb I go by. Most of my snippets have more than 2, but this one doesn\'t. I will probably clean up the code a little bit soon, but besides that everything works fine.
on ur first if line you could just do this
if ($len($1) isnum 2-10 && !$2) {
instead of doing
if ($1) && (!$2) && ($len($1) > 1) && ($len($1) < 11) {
aslo why do
%\' = $remove(%\',$chr(9))
when you can add that into the html strip
alias -l z {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ,$chr(9))
return %x
}
and you can remove the halts as well and instead of having 2 lines to unset vars why not just do ur var\'s like %cy.chan and %cy.name then you can unset them like
unset %cy.*
and these lines
if (%supchan ischan) { msg %supchan $z(%\') | unset %supchan }
else echo -a $z(%\')
can be like this with the vars i told you to set
$iif(%cy.chan ischan,msg %cy.chan $z(%\'),echo -a $z(%\'))
just a few things to think about...