Hi guys ,back again to pick your brains.Rather than open a new thread I thought I'd post here since its related to the same script.The below script is what we have come up with after all your help here (which was great btw) but we have found a problem and cant seem to get it right.

The problem is if someone comes in and does say, !faq 2009 it doesnt find my topic with [2009],it just returns nothing found in the notice.Also if they say for example search !faq 100 (or any number below 1000) and I don't have [100] as a topic ,it will give the following error in my status window:
Quote:

* /play: topic '[100]' not found in 'faq.db' (line 19, FAQ.mrc)


Here is an example of the channel output with the 2009 problem:

Quote:

<DOOM> !faq opened channel
*FAQBot* The channel was opened in 2009 by D00M!
<DOOM> !faq 2009
*FAQBot* Sorry Your Question " 2009 " was not found!


Here is the script we ended up with:
Code:
on *:TEXT:!faq*:#MY_CHAN:{
  inc %faq69
  var %f = faq.db, %x = $replace($2-,$chr(32),_)
  if ($ini(%f,%x)) { play $+(-nt,%x) $nick %f }
  else {
    if (!%faq.flood) {
      inc -u3 %faq.flood
      notice $nick Sorry Your Question " %x " was not found!
    }
  }
}


And here is an example of the faq.db setup:
Code:
[channel]
The channel was opened in 2009 by D00M!
[Opened]
The channel was opened in 2009 by D00M!
[2009]
The channel was opened in 2009 by D00M!
[channel_Opened]
The channel was opened in 2009 by D00M!
[Opened_Channel]
The channel was opened in 2009 by D00M!
[Opened_2009]
The channel was opened in 2009 by D00M!


We tried:

Code:
$iif($2- == 0,$null,$replace($2-,$chr(32),_)))


but its still not returning the number 2009 (or any number above 1000) when in fact they are in the faq.db or gives the status window error above with any number not present below 1000 instead of noticing the nick it wasnt found.Everything as worked great up until now so any help/advice again would be great,TIA

DOOM.


Last edited by D00M; 11/04/11 06:57 PM.