mIRC Homepage
hi, is there a script that answers questions from txt file?
like i could list a load of questions in a .txt file and have the answers, and something will answer me on a chat when i ask it.
In your mIRC folder, create a file called q.txt in the following format:
  • question
    [color:green]answer

    question
    answer[/color]
(odd lines = questions; even lines = answers)

Enter this code into the Scripts Editor (Alt+R):

On me:*:join:[color:blue]#chan:{
  • if !$isfile(q.txt) {
    echo -gtc info # * Note: couldn't find $mircdirq.txt (questions file)
    return
    }
    if $hget(q) { hfree q }
    hmake q
    hload q q.txt
}

On *:text:*:#chan:{
  • if $hget(q,$strip($1-)) { msg # $ifmatch }
}[/color]

Change both occurrences of #chan to the name of the channel where the script will take effect.

Connect the bot, and get somebody to type one of your defined questions. The bot will then message the channel with the corresponding answer.
it doesnt work. i do put it in remote dont i?
Yes, put the gray code in the remote, and make the bot join the channel. Do you get any errors?

Remember, q.txt must be in the mIRC folder.
© mIRC Discussion Forums