Only gets error when i use $chan:
Code:
on *:TEXT:*:#:{
  tokenize 32 $strip($1-)
  if (*!ep* iswm $1-) {
    /tvrage $2
    if ( %show_class != Scripted ) { halt }
    <rest of code>
  }
}

alias tvrage { 
  unset %tvrage*
  unset %tv.*
  unset %show*
  %tvrage = $replace($1,$chr(46),% $+ 20)
  %tv.rel = $replace($1,$chr(46),$chr(32))
  set %tv.release $2
  set %tv.section $3
  sockopen tvrage http://www.tvrage.com 80
}

on *:sockopen:tvrage:{
  sockwrite tvrage GET $+(http://www.tvrage.com/quickinfo.php?show=, %tvrage,$crlf) HTTP/1.1
  sockwrite -n tvrage Host: $+(www.tvrage.com,$crlf,$crlf)
}
on *:sockread:tvrage:{
  if ($sockerr) { return }
  var %tvdata
  sockread %tvdata
  if (show name isin %tvdata) { set %show_name $gettok(%tvdata,2,64) }
  if (show url isin %tvdata) { set %show_url $gettok(%tvdata,2,64) }
  if (premiered isin %tvdata) { set %show_premiered $gettok(%tvdata,2,64) }
  if (latest episode isin %tvdata) { set %show_late_ep $gettok(%tvdata,2,64) }
  if (next episode isin %tvdata) { set %show_next_ep $gettok(%tvdata,2,64) }
  if (country isin %tvdata) { set %show_country $gettok(%tvdata,2,64) }
  if (status isin %tvdata) { set %show_status $gettok(%tvdata,2,64) }
  if (classification isin %tvdata) { set %show_class $gettok(%tvdata,2,64) }   
  if (genres isin %tvdata) { set %show_genre $gettok(%tvdata,2,64) } 
  if (network isin %tvdata) { set %show_network $gettok(%tvdata,2,64) } 
  if (airtime isin %tvdata) { set %show_airtime $gettok(%tvdata,2,64) } 
  if (runtime isin %tvdata) { set %show_runtime $gettok(%tvdata,2,64) } 
  if (!sockbr) { return } 
}
on *:sockclose:tvrage:{
  msg $chan Show: %show_name • Genre: %show_genre • Premiered: %show_premiered • Latest: %show_late_ep •  Next: %show_next_ep • Status: %show_status
}

And when i do "!ep lost" etc in chan, its try to msg show..
Code:
[02:18:52] -> *Show:* Lost • Genre: Action | Adventure | Drama | Mystery • Premiered: 2004 • Latest: 04x14^There's No Place Like Home (3)^May/29/2008 • Next: 05x00^Season 5 Recap Special^Jan/21/2009 • Status: Returning Series
-
Show: No such nick/channel
-


Any idea?