_Dean_ commented on a Page, 2 in 1 - Tinyurl and !d (google define) sockets  -  Feb 09, 2011

this

if ($sockerr) msg %tchan $sockerr

will only return a number... if you want to send something more specifically

try $sock($sockname).wsmsg

.wsmsg returns the last winsock error message match the error number

from the help file

by the way, if you used regex on it, this is a tip
this

on *:SOCKREAD:turl:{
  if ($sockerr) msg %tchan $sockerr
  var %turl | sockread %turl
  var %a = copy('http://tinyurl.com/
  var %b = ');
  if (%a $+ * $+ %b iswm %turl) {
    var %link = $remove(%turl,$left(%turl,6),$right(%turl,3))
    if ($remove(%link,$left(%link,19)) != %alias) && (%alias) { msg %tchan This custom alias ( $+ %alias $+ ) is not available or is being used. You may try again by typing !tinyurl link alias. 
      msg %tchan Here is another link: %link
    }
    else { msg %tchan Here is the link: %link }
  }
}

as Jethro_ said you could use sockmark instead

i will give you some examples using ur vars

on *:SOCKREAD:turl:{
  if ($sockerr) msg %tchan $sockerr
  var %turl,%y = /<blockquote><b>(.+)<\/b>/ 
  sockread %turl
  if $regex(%turl,%y) {
    msg %tchan here is your link: $regml(1)
  }
  if (The custom alias isin %turl) { 
    msg %tchan The custom alias you've chosen is not available. We've created a random one for you 
  }
}

this will return, if the alias already exist, and then return another one

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.