hey, ive got this socket file that ive made, it works fine and all as long as there are only one person at a time requesting the info.but say if 1 person requests a piece of info right after the other, it wont process, so what i need help with is maybe a "queue" system for it, in will process eveyrthing, even if their one after the other. I was thinking maybe using a temp file or a window. However when i tried it did not work, so would be good to see if someone else can. Script is below

Code:
on *:TEXT:!movieinfo *:?:{
  if ($isfile($remove($2-,$chr(32)) $+ .hsh ) == $true) { hload $remove($2-,$chr(32)) $+ .hsh $remove($2-,$chr(32)) $+ .hsh | msg $nick MovieInfo For $2- | msg $nick $hget($remove($2-,$chr(32)) $+ .hsh,Genre) | msg $nick $hget($remove($2-,$chr(32)) $+ .hsh,Tagline) | msg $nick $hget($remove($2-,$chr(32)) $+ .hsh,Plot) | msg $nick $hget($remove($2-,$chr(32)) $+ .hsh,site) }
  else {
    hmake $remove($2-,$chr(32)) $+ .hsh 
    set %movietitle $2- 
    set %movieinfonick $nick 
    msg $nick Please Wait While We Retrieve The Info (No longer Then 30 Secs)
    sockwrite -n movieinfo1 GET /find?q= $+ $replace(%movietitle,$chr(32),$(%20,)) $+ ;s=all HTTP/1.1
    sockwrite -n movieinfo1 Host: www.imdb.com $+ $crlf $+ $crlf
    set %zinfonumber 1
  }
}

alias movieinfo {  movieinfo1 www.imdb.com 80 | echo -at A }

on *::movieinfo1: {
  sockwrite -n $sockname GET /find?q= $+ $replace(%movietitle,$chr(32),$(%20,)) $+ ;s=all HTTP/1.1
  sockwrite -n $sockname Host: www.imdb.com $+ $crlf $+ $crlf
  set %zinfonumber 1
  ;echo -at Succesfully Opened Socket
}
on *:sockread:movieinfo1:{
  if ($sockerr) {
    ;echo -a Error
    Halt
  }
  else {
    var %tmptxt
    sockread -f %tmptxt
    ;echo -a %tmptxt
    if (Location: isin %tmptxt) {
      set %movieinfolink2 $remove(%tmptxt,Location: http://www.imdb.com)
      movieinfo2 www.imdb.com 80
    }
    else {
      if (<p><b>Popular Titles</b> isin %tmptxt) {
        set %movieinfolink2 $gettok(%tmptxt,2,34)
        echo -a %movieinfolink2
        sockopen movieinfo2 www.imdb.com 80
      }
    }
  }
}

on *:sockopen:movieinfo2:{
  sockwrite -n $sockname GET %movieinfolink2 HTTP/1.1
  sockwrite -n $sockname Host: www.imdb.com $+ $crlf $+ $crlf
  set %zinfonumber 1
  hadd $remove(%movietitle,$chr(32)) $+ .hsh site For Full Details Visit: http://www.imdb.com $+ %movieinfolink2
}

on *:sockread:movieinfo2:{
  if ($sockerr) {
    ;echo -a Error
    Halt
  }
  else {
    var %tmptxt
    sockread -f %tmptxt
    ;echo -a %tmptxt
    if (<b class="ch"> isin %tmptxt) {
      if (%zinfonumber <= 3) {
        if (%zinfonumber = 1) { inc %zinfonumber }
        elseif (%zinfonumber = 2) { hadd $remove(%movietitle,$chr(32)) $+ .hsh Tagline $remove($replace($htmlconv(%tmptxt),Tagline:,Tagline:,Plot Outline:,Plot Outline: ),(more),(view trailer)) | inc %zinfonumber }
        elseif (%zinfonumber = 3) { hadd $remove(%movietitle,$chr(32)) $+ .hsh Plot $remove($replace($htmlconv(%tmptxt),Tagline:,Tagline:,Plot Outline:,Plot Outline: ),(more),(view trailer)) | inc %zinfonumber | replywithstuff }
        ;echo -at $remove($replace($htmlconv(%tmptxt),Tagline:,Tagline:,Plot Outline:,Plot Outline: ),(more),(view trailer))
      }
      if (Genre: isin %tmptxt) { set %genrecatch 1 }
    }
    elseif (%genrecatch <= 1) {
      hadd $remove(%movietitle,$chr(32)) $+ .hsh Genre Genre: $+ $chr(32) $+ $remove($htmlconv(%tmptxt).rem,(more))
      unset %genrecatch
    }
  }
}


alias htmlconv {
  var %t, %u = $regsub($replace($1,<br>,$crlf),/^[^<]*>|<[^>]*>|<[^>]*$/g,,%t)
  if (!$regex(%t,/&\S+?;/)) return %t
  if ($prop == rem) return $(,,$regsub(%t,/&\S+?;/g,,%t)) %t
  %t = $replace(%t, ,$chr(160),",",<,<,>,>,&,&,…,...,®,®, $&
    ©,©,,™,™,¼,¼,½,½,¾,¾,³,³,²,²,°,°,•,•, $&
    ›,›,‹,‹,»,»,«,’,’,‘,‘,&rdguo;,”,“,“,–, $&
    –,—,—,',',˜,~,×,×,÷,÷,¶,¶,&ecute;,é,&Ecute;,É,¢, $&
    ¢,£,£,¥,¥,§,§)
  if ($version < 6.14) || (!$regex(%t,/&\S+?;/)) return %t
  var %html = html $+ $ticks, %body = body $+ $ticks
  .comopen %html htmlfile
  if ($comerr) return %t
  %t = $com(%html,write,1,bstr*,$+(<html><body>,%t,</body></html>))
  %t = $com(%html,body,2,dispatch* %body) $com(%body,innertext,2)
  %t = $com(%body).result
  :error
  if ($com(%body)) .comclose %body 
  if ($com(%html)) .comclose %html
  return %t
}

alias _htmlconv {
  if (!$isfile($1)) || ($os isin 9598) return 0
  var %in = $shortfn($1), %out = $shortfn($2), %mss = mss $+ $ticks
  if (* !iswm $2) %out = %in
  .comopen %mss MSScriptControl.ScriptControl
  if ($comerr) return 0
  var %t, %n = $crlf
  %t = $com(%mss,language,4,bstr*,vbscript)
  %t = $&
    set html = createobject("htmlfile") %n $&
    set fso = createobject("scripting.filesystemobject") %n $&
    set inf = fso.opentextfile( $+(",%in,") ) %n $&
    src = inf.readall %n $&
    inf.close %n $&
    html.write "<html><body>" & src & "</body></html>" %n $&
    set outf = fso.createtextfile( $+(",%out,") ,true) %n $&
    outf.write html.body.innertext %n $&
    outf.close 
  %t = $com(%mss,executestatement,1,bstr*,%t)
  .comclose %mss
  return %t
  :error
  if ($com(%mss)) .comclose %mss
  return 0
}

alias -l replywithstuff { msg %movieinfonick MovieInfo For %movietitle | msg %movieinfonick $hget($remove(%movietitle,$chr(32)) $+ .hsh,Genre) | msg %movieinfonick $hget($remove(%movietitle,$chr(32)) $+ .hsh,Tagline) | msg %movieinfonick $hget($remove(%movietitle,$chr(32)) $+ .hsh,Plot) | hsave -o $remove(%movietitle,$chr(32)) $+ .hsh $remove(%movietitle,$chr(32)) $+ .hsh | msg %movieinfonick For Full Details Visit: http://www.imdb.com $+ %movieinfolink2 }


but like i said the script itself works great.

Basically the only condition would be

if 1) Requests the file && it has not yet been retrieved - if someone else requests during the search and it HAS been retrieved before (i.e theres a hashtable) then send nick2 its info automatically

2nd scenario is exactly the same - except if the 2nd request HASNT been retrieved before, then put nick2 in the queue