mIRC Home    About    Download    Register    News    Help

Print Thread
#200289 01/06/08 08:12 PM
Joined: Aug 2007
Posts: 41
P
Panic Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Aug 2007
Posts: 41
Hello, I am looking for a scripter to script the following i think this is going to be very hard. Links to other already made scripts are allowed.

I need a script that when anyone with 200 access type [QUESTION] <Text e.g. Do you like coffee> [ANSWER] <The Bot Reply e,g. Coffe is good> it will safe to a .txt file and when someone asks the bot. Bot, Do you like coffee - It will reply with Coffe is good is this posible

Format:

[QUESTION] <QUESTION> [AMSWER] <ANSWER>
<Person> <Question>
<Bot> <Answer>

Thanks in advance
~ Panic

Last edited by Panic; 01/06/08 08:29 PM.

CrazyMan IRC Bot Admin
IRC UnGoWa Support
NeoBlab Server-Admin
Chat Operator
Panic #200303 02/06/08 04:12 AM
Joined: Mar 2004
Posts: 526
Fjord artisan
Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
I would suggest you search the mIRC sceript sites. there are MANY scripts alredy written that do this type of simulation of database work


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Panic #200304 02/06/08 05:03 AM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Here's a fast one none tested that should work given that my knowledge of $ulevel counts has user level "200"

if user level is 200 and [question] is the first word then it writes the line to $1-

Then if a user types <data> it will search safely through the text file and treat it has plain text for <data> and if it matches should return data after [answer] as long has the word answer is spelled correctly.

Code:
on *:TEXT:*:#:{
if ($1 == [question]) && ($ulevel == 200) {
write ai.txt $1-
}
elseif (< isin $1) {
var %x = $read(ai.txt,nw,$+(*<,$1-,>*))
if (!%x) { msg # Sorry no match found for question $1- }
else {
msg # $gettok(%x,$+($calc($findtok(%x,[answer],1,32)+1),-),32)
}
}
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }

Link Copied to Clipboard