Here's one I made a while ago. It's designed to work with Tat's Trivia Bot but with tweaking should work with others.

It searches the answer file for the question and then echos the answer. When a question is asked and the answer is not known then the question and answer are stored in a seperate file of captured questions.

Code:
on *:TEXT:*:#: { 
  var %Str $strip($1) 
  if ($left(%Str,1) isnum) && ($right(%Str,1) == .) { 
    var %Question = $remove($strip($2-) , ?) 
    var %ReadDat = $remove($read(C:\Program Files\mIRC\Remotes\Trivia\questions.txt, w, %Question $+ *), %Question, *, ?)
    $iif(%ReadDat != $null, echo $chan Answer: %ReadDat, echo $chan Answer not found)
  }
}

on *:TEXT:*:#: { 
  var %Str $strip($1) 
  if ($left(%Str,1) isnum) && ($right(%Str,1) == .) { 
    var %Question = $remove($strip($2-) , ?)
    var %Answer = $remove($read(C:\Program Files\mIRC\Remotes\Trivia\questions.txt, w, %Question $+ *), %Question, *, ?)
    if (%Answer == $null) { var %Answer = $remove($read(C:\Program Files\mIRC\Remotes\Trivia\captured.txt, w, %Question $+ *), %Question, *, ?) }
    if (%Answer != $null) { echo $chan Answer: %Answer }
    else { set %Question %Question | set %TriviaBot $nick }
  }
  elseif ($nick == %TriviaBot) && (%Str == Winner:) {
    var %Captured = $+(%Question,*,$left($right($gettok($1-,3,58),-1),-4))
    write "C:\Program Files\mIRC\Remotes\Trivia\captured.txt" $$iif(%Captured != *,%Captured)
    unset %Question %TriviaBot
  }
}