Since socket events are asynchronous (they happen whenever the remote server decides to respond), you can't integrate them into a onTEXT event with an $identifier. You can execute a command in the onTEXT event that starts the socket procedure, and then have a mechanism for displaying the result within the onSOCKREAD event.

Example:

Code:

on *:TEXT:!start &:#:{
  startsocket $chan $2
}

alias startsocket {
  sockmark mysock $1
  sockopen mysock www.foo.com 80
}

on *:SOCKOPEN:mysock:{
  sockwrite -n mysock GET / HTTP/1.0
  sockwrite -n host: www.foo.com
  sockwrite -n
}

on *:SOCKREAD:mysock:{
  var %s
  sockread %s
  msg $sock(mysock).mark > %s
}



-genius_at_work