mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2004
Posts: 3
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Jul 2004
Posts: 3
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.

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.

Joined: Jul 2004
Posts: 3
M
Self-satisified door
OP Offline
Self-satisified door
M
Joined: Jul 2004
Posts: 3
it doesnt work. i do put it in remote dont i?

Last edited by matteh117; 04/07/04 07:28 PM.
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
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.


Link Copied to Clipboard