First of all, please don't get your hopes up as I'm not offering you a working code example here, just pointing you in the right direction to get what you want :p

Your $cookie_file makes an assumption that the mIRC folder is in %appdata% but this isn't always the case. You should instead use a COM object to get the value of the %appdata% environment variable like so:

Code:
alias cookie_file {
  if (%ffcookies) return $v1
  var %object = appdata $+ $ticks, %ffdir, %result
  .comopen %object wscript.shell
  noop $com(%object,expandenvironmentstrings,3,bstr,% $+ appdata%\Mozilla\Firefox\profiles.ini)
  %ffdir = $com(%object).result
  %result = $+($nofile(%ffdir),$replace($readini(%ffdir,Profile0,Path),/,\),\cookies.sqlite)
  .comclose %object
  if ($isfile(%result)) { set %ffcookies %result }
  return %result
}


It only does the slow process of using $com once and then caches the value. All subsequent calls to $cookie_file just retrieve the cached value.

As for reading the file itself, you have two options that I can think of: -

1) Read this page thoroughly and write a script which reads the SQLite database. It's a very in-depth document explaining the format of an SQLite file. The database files are in a binary format, which is why simply looping with $fread() won't get you anywhere.

2) Download mIRC SQlite which is a DLL and can read from SQLite databases.

The second option will of course be much simpler. smile