Hey guys ,back to pick your brains again,
The above !FAQ works nice but it will end up becoming very large and take a lifetime for it to finish the notice and its not very specific.So we thought of trying to make a script that when users type in the chan as an example: !faq TEST or !faq BSG or what ever, it will search a txt file for the key word and return the result to them as a .notice. A friend and I managed to get this far but seemed to have hit a wall (he knows more than me but we are still both learning) so here is what we have so far:
on *:TEXT:!faq*:#MYCHAN: {
.notice $nick Results:- " $+ $read(faq.txt) $+ "
}
menu * {
.Update FAQs: var %a $?="Add FAQs Answers Here ,e.g BSG - ANSWER HERE:" | write FAQ.txt %a
}
And this is what I have in the text file
BSG - ANSWER_HERE
TEST - ANSWER_HERE
TEST2 - ANSWER_HERE
TEST3 - ANSWER_HERE
TEST4 - ANSWER_HERE
Ok first Im not sure how I should have the text file setup so it returns the correct results or if we are even going about it the right way.As it stands I can update/write single lines to the faq.txt file with a right click on the screen and select Add FAQs from the menu,which is what we want so that part works fine but when we try to search the text it just comes back with random lines from the .txt file.This is what we get in the chan:
[9:21pm] <Z0n3r> !faq BSG
[9:21pm] *D00M* Results:- "TEST3 - ANSWER_HERE"
[9:21pm] <Z0n3r> !faq BSG
[9:21pm] *D00M* Results:- "TEST - ANSWER_HERE"
[9:22pm] <Z0n3r> !faq test2
[9:22pm] *D00M* Results:- "TEST4 - ANSWER_HERE"
[9:22pm] <Z0n3r> !faq test2
[9:22pm] *D00M* Results:- "TEST3 - ANSWER_HERE"
[9:22pm] <Z0n3r> !faq test2
[9:22pm] *D00M* Results:- "TEST3 - ANSWER_HERE"
[9:22pm] <Z0n3r> !faq test2
[9:22pm] *D00M* Results:- "TEST - ANSWER_HERE"
[9:22pm] <Z0n3r> !faq test2
[9:22pm] *D00M* Results:- "TEST4 - ANSWER_HERE"
So as you can see its just calling random lines from the faq.txt file instead of the answer we want.Any help tips would be great ,TIA
