mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#185821 14/09/07 07:13 PM
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
ok I really don't get the concept of a self learning script. well the scripting for it anyway. if anyone could help me out with some examples so I can better understand how it functions so I can write one of my own for my bot. thank you.

Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Originally Posted By: negeren
ok I really don't get the concept of a self learning script. well the scripting for it anyway.

Obviously you know something about the concept of self learning. If you tell more, we can help you scripting it wink

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
I'm not shure what you looking for, but one way to do it is like:

!learn bla is bla bla

!learn hello is hi there, how are you $nick

then make the bot store the lines in a *.txt file, and when ever a word is said on the channel, lets say hello, then the bot reply to that user "hi there, how are you $nick", is this what you looking for?


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
ehm ... is that a SELF learning concept???

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
yes, many bot's using that. One perl bot that are populare..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
I merely expected a method with which the bot can learn by itself, not by telling it to learn .... I use a quite simple method for my own bot, but I hoped negeren could explain a more sophisticated concept smile

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
You're getting into the realm of artificial intelligence. Is it possible to make a self learning bot? Possibly, but it would be far and away the most complex ever script ever written.

I've toyed around with having bots pick up on bad words by themselves, but it was too difficult and by the time I was done I was only around batting 20% with a ton of false positives.


Yar
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
ok I know the common
on *:text:*hello:$chan { /msg hello $nick }
commands but I was thinking more along the lines of nick recognition and text comparison.
like with above on text command it will look for hello anywhere in the beginning text. but what if the bot says hey $nick randomly. then $nick says hello $me how are you then the bot replies hello again instead of I'm good how are you. or what if $nick says whats up $me how are you.
ok now lets say we have it set up to say.
on *:text:*hi:$chan { /msg hello $nick }
on *:text:how are you*:$chan { /msg I'm good and you }
and the bot replies to the first trigger so it says hello $nick.
or the bot replies to the second trigger so it says I'm good and you. but what if it could combine the responses to say hello $nick how are you. or as in the first example it says I'm good.
I have seen many pearl bots and vb bots that learn from chatting with users so I was wanting to build a AI engine so the bot self learns from scratch and can write its own script.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
As was mentioned before, this is possible, however it is unbelievably complicated. It would likely involve neural net structures and fuzzy logic, and that is just for starters. The mIRC scripting language can undoubtedly perform the necessary logic, just as any other standard language can.. that is, if you can figure out how to make the code properly. You could start by researching AI as a general topic and see if you can comprehend it enough to create binary logic that will act as AI.

Good Luck.

-genius_at_work

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Keep in mind that there are a couple good chat bots out there that can respond correctly to a surprising amount of conversation. They don't "learn" afaik, but it's a good place to look to get started. I don't know the names of them, but searching for stuff like "mIRC AI bot" might help. I think one is something like Lucy Bot or Mary Bot or some female name like that.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
are you talking about the alice bot

Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
As genius_at_work pointed out, it is difficult to script a self-learning bot. I have made an AI-bot for mirc and although its capabilities are limited, it succeeds in fooling people quite well smile

For an AI chatbot you need the following components:
(1) An eventhandler that decides when to answer somebody who is calling it. My bot is capable of having a conversation with a predefined maximum number of people in a chatroom, ignoring other people who are talking. I use about 10 timers to control the bot in a way that it looks like a human chatter. It is also possible to transfer a conversation from one chatter to another.
(2) A dialog handler that recognizes words and phrases and generates an answer. It also determines what to do after putting the answer on the channel: keep on listening to the chatter, ignore the chatter, go into a second level dialog, etc.
(3) Besides word and phrase recognition it is nice to have some kind of a self-learning system. I use this one:
- the bot logs every sentence that contains 5 or more words (it skips color codes and special characters like , . : : etc)
- if it cannot recognize a word or phrase it will search in the logfile for two lines that contains the first 3 words of a chatter's sentence
- if it finds two lines it takes the first half of the first line and the second half of the second line, combines them and puts that as an answer in the channel

For instance somebody says: "i got a brand new car" and it finds the two lines: "yesterday i got a strange email" and "that is how i got a virus", it will combine them to: "yesterday i got a virus". This is a simple example but sometimes it produces quite nice answers.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: negeren
are you talking about the alice bot


Yes, that is the one. I haven't used it, but I hear it's a decent response bot that fools many people. In any case, it's not a bad place to start.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I also started making an AI bot, but I just decided it wasn't worth it and it's just sitting in a folder on my computer. smile

I like your 3rd item. That could provide for some very interesting responses.


Invision Support
#Invision on irc.irchighway.net
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Well, I think it was worth to make it. I'll give you three examples (Berend is my bot):

This one is based on searching the "three words technique":
Code:
[05-04-2006 08:15:20] <sunshine^koffie> can I have a coffee Berend-Botje
[05-04-2006 08:15:26] <Berend-Botje> honey can i have a specification


This one is based on the "three words technique" plus phrase recognition:
Code:
[05-04-2006 20:17:48] <HandsomeM33> i am looking for a nice girl who wants to have a 
serious date
[05-04-2006 20:17:54] <Berend-Botje> hello i am looking for an exciting date 
tonight with a lady
[05-04-2006 20:18:05] <Dutchgirl45> go to a dating site HandsomeM33
[05-04-2006 20:18:07] * Bono-Smiles is available for Berend-Botje
[05-04-2006 20:18:11] <Berend-Botje> do you love me Bono-Smiles?


And this one is based on phrase recognition only:
Code:
[06-04-2006 01:48:44] <gentleman> everybody gone to sleep??
[06-04-2006 01:48:47] <Berend-Botje> *yawn* me too :S
[06-04-2006 01:48:54] <gentleman> ok man
[06-04-2006 01:49:04] <Berend-Botje> you know, i look at you and i think i am going 
to fall in love with you 
[06-04-2006 01:49:14] <gentleman> HUH???
[06-04-2006 01:49:17] <Berend-Botje> huh?
[06-04-2006 01:50:03] <gentleman> why???
[06-04-2006 01:50:40] <gentleman> BB?
[06-04-2006 01:50:44] <Berend-Botje> you called me gentleman?
[06-04-2006 01:50:56] <gentleman> well i don't know
[06-04-2006 01:51:00] <Berend-Botje> i know a joke!
[06-04-2006 01:51:09] <gentleman> yes a good one please
[06-04-2006 01:51:15] <Berend-Botje> that's my idea too :)
[06-04-2006 01:51:21] <gentleman> whahahaha
[06-04-2006 01:51:25] <Berend-Botje> LOL LOL LOL

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
I've done a bit of work with some of the ideas from above. Sadly, even when it "fools" people, they tend to think its just on drugs.

Make sure it can fool the perfect bot test. "Hey Nick, what is 2+2?"

I've yet to see a bot answer 4. Usually, its "lol!" or "That's a silly question!" or something to avoid answering the question at all. This is fairly easy to do to, if you know a bit of Regex.

Also, bots don't make mistakes but people do! Make sure you toss in the occasional typo. Its best to make a list of letters to typo. For instance, common typos for F would be D, G, C, V, E, and W. Those are the letters next to D on the keyboard.

Also, switching letters in words is another common typo. Instead of "Table" you'd do something like "Talbe". Some mistales are more common than others

I've found that by adding these typos to words greatly increases the chance of fooling some one.

Last edited by Thrull; 16/09/07 02:43 AM.

Yar
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
LOL
Originally Posted By: Thrull

Make sure it can fool the perfect bot test. "Hey Nick, what is 2+2?"

My bot will answer: 4. It is - amongst other things - also capable of telling the time and date, sending pictures of itself on request and to recognize chatters by sexe. You can ask him in various ways ("how much is .." "please calculate ...", "do you have a picture", "can you send a picture") and answers are choosen randomly, like "i think 4", "4 it is", "ehm ... 4!" etcetera.

Originally Posted By: Thrull

Also, bots don't make mistakes but people do! Make sure you toss in the occasional typo. Its best to make a list of letters to typo. For instance, common typos for F would be D, G, C, V, E, and W. Those are the letters next to D on the keyboard.

Also, switching letters in words is another common typo. Instead of "Table" you'd do something like "Talbe". Some mistales are more common than others

I've found that by adding these typos to words greatly increases the chance of fooling some one.

It does too and even corrects himselves (randomly, not every time). It also misses a letter sometimes.

Another feature is that he delays his answer according to the length of the sentence he has to place in the channel. Some people really believe somebody is typing on a keyboard.

Now, it looks like I present this as THE perfect AI bot for mirc, but it isn't. By far it isn't! The trick is that most chat conversations are about the same subjects, namely: nothing. This makes it easy to get a conversation going. Features like delay, typo's and knowing how to calculate gives the bot a human face, which fools average chatters. Can you imagine that some people ask whether Berend-Botje is male or female (Berend is a Dutch name for boys only) ?? Berend will answer something like: were did you get your biology lessons? "At school" is the most given answer .....

Chatting is about nothing at all :p

Joined: Aug 2006
Posts: 183
T
Vogon poet
Offline
Vogon poet
T
Joined: Aug 2006
Posts: 183
Oh, I'm sure your bot is great for doing that kind of thing. Can it pass the Turing Test? Probably not. And if it CAN, then there's like a million dollar prize for you to claim.

You're quite correct in that most of the idle chat on IRC is just that: Idle chat. I don't tend to go to those types of channels so the few attempts I made at a bot did much much worse than they could have if I went elsewhere.

Perhaps I should try again. I'll add it to my ever-growing to do list. smile


Yar
Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Originally Posted By: Thrull
Can it pass the Turing Test?

5 minutes maybe, 10 at most, but much longer for chatters how won't pass either grin

Originally Posted By: Thrull
Perhaps I should try again. I'll add it to my ever-growing to do list. smile

Good luck! It took me about 6 months to complete. Maybe I'll write a kind of "recipe" if anybody is interested...

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Originally Posted By: noMen
Maybe I'll write a kind of "recipe" if anybody is interested...


Yeah sounds pretty good, write one for a chicken korma.

* SladeKraven loves his korma.

Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Ingredients:
1.5kg Chicken breasts or chicken joints, skinned and washed
1 heaped tablespoon of finely grated fresh ginger
3 crushed cloves of garlic
150g thick natural set yogurt
3 dried red chillies
2 finely chopped onions
cooking oil
1 tbsp ground coriander
a pinch of ground black pepper
1 tsp turmeric
1 tsp garam masala
water
75g creamed coconut
salt, to taste
2 heaped tbsps ground almonds
finely chopped coriander leaves, to garnish
Squeeze of lemon juice

Instructions:
1. Cut the chicken breasts into bite sized chunks or, if using joints, separate leg from thigh.
2. Mix the chicken with the ginger, garlic and yogurt. Cover and marinade for 3-4 hours or in the fridge overnight.
3. Liquidise the chopped onion and red chillies, adding water if needed, to make a smooth paste.
4. Heat some oil in a pan.
5. Add the ground coriander, ground black pepper, turmeric and garam masala and stir fry for about 1-minute over a low heat.
6. Turn up the heat, add the onion and chilli paste and stir fry for 10-minutes.
7. Add the chicken and the marinade and continue to stir fry for another 10-minutes.
8. Add the creamed coconut and enough water to cover the chicken and bring to the boil, stirring until the coconut is dissolved.
9. Reduce heat to low, cover the pan and simmer until the chicken is tender (30-40 minutes).
10. Remove from heat, stir in the ground almonds, lemon juice and salt to taste. Mix well.

Serving ideas: Garnish with coriander leaves and serve with Onion Bhaji and Pilau Rice or Rotis.

Suitable for freezing.

Next time: google for yourself :p

Last edited by noMen; 16/09/07 06:25 PM.
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
I just don't get the coding that is involved, I mean I have been researching this for about 8 months now. I have seen many bots and have even searched thru the AI brains of some pearl scripts. and am still no closer to getting this. the pearl bots tho are great I just need to figure out how the coding in the pearl bots transfer to the mIrc coding and then I would have a much better understanding of how I need to write this.

Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Obviously you want to know how I did it (take a cup of coffee and read):

I've put all the phrases and words that should be recognized in an .ini file (main), the answers the bot should give in another .ini file (answer) and special words and phrases for second level dialogues in a third .ini file (special).

The main file contains three sections in which I store words and phrases for direct conversation (somebody calls the bot and talks to it), interference (nobody calls the bot, but the bot sometimes reacts to something that is said, f.i. somebody says "i'm going to sleep" then the bot could say "have a good night") and random replies (when there is no direct conversation and nobody said something that could be recognized then the bot sometimes smiles, yawns or says "brb, I have to kick the cat outside"). I will explain later how I organized the words and phrases in these sections and how I organized the answers and special dialogues.

The script contains two main parts: an event handler and a dialogue handler. The task of the event handler is to prevent that the bot reacts to everybody and everything, to simulate human behaviour (or better: average chatter behaviour) and to recognize phrases and words. If something could be recognized it passes the matched string to the dialogue handler and tells the dialogue handler what kind of conversation is going on (direct, interference or random). I will explain later how the event handler uses timers to simulate chatter behaviour.

The dialogue handler generates answers, performs functions to incorporate into the answers and tells the event handler what to do next. Every answer in the answer file contains some special characters, with which I can influence the event and dialogue handler. Most of these codes only have effect to the dialogue handler, e.g.:
- give the answer immediately (for helpdesk channels) or delayed
- don't make syntax errors in this answer (e.g. for helpdesk channels, btw the bot can have several kinds of conversations in several rooms concurrently)
- issue this answer as a message or an action
- fill in the nickname, time, date, result of a calculation, etc
- execute a command together with this answer (/kick, /dcc send, start a game, tell a joke, etc.)
- find out the chatter's sex (formal replies for helpdesks - sir, madam - or informal replies - honey, stud -)
- go into a second level dialogue
... and more.

There are 4 codes in answers that can be passed to the event handler:
- keep on listening to this chatter, conversation is not finished
- ignore this chatter, conversation with him is over
- be quiet for a number of minutes
- find out yourself what should happen next

The event handler uses a number of timers to simulate chatter behaviour and can listen to only one, two or another maximum number of chatters. These parameters are stored in a separate .ini file. The most important timers it uses are:
- listen to one chatter only during a certain number of seconds (direct conversation when somebody called the bot's name or the dialogue handler told to do so)
- don't listen to anybody until the last (delayed) answer has been put in the channel (the bot does one thing at a time: òr listening òr answering)
- when somebody joins the channel, listen for some time to everybody, no matter if there is a direct conversation going on (newcomers can take over a conversation)
There are more timers, but I have to dive into details to explain them.

I use some parameters to define the reaction level for the event handler. When somebody calls the bot's name, the event handler will stick to that chatter, but if not it will randomly try to find out whether it can interfere or should trigger a random answer. Otherwise it will randomly try to combine two sentences from its log based on the first three words of a chatter's sentence (I explained this in one of my earlier replies). This gives quite varied behaviour.

Now I come back to the organization of phrases, words and answers. These are stored in three .ini files: main, answers and special. I can have several groups of these files, a group for normal channels, several groups for several heldesk channels, groups for word-games, groups for operator channels (the bot can present a menu that contains commands to execute in another channel were the bot is joined as an operator), etc.

The main .ini file contains three sections, one which contains phrases and words to be recognized during direct conversations, one which contains words to be recognized when the bot is going to interfere and one which is used when the bot has to generate a random answer. Every section contains a number of items in which the phrases and words to be recognized are stored.

For direct conversations I use three kinds of items: one kind with regex matchstrings which enables the bot to recognize a variety of sentences with the same meaning, one kind that contains words or phrases that have to be recognized completely and one kind that can be recognized partially. The event handler searches these in a strict order: first direct regex, then direct full recognition, then direct partial recognition, then interfere and at last random. An example:

main .ini file (note that an item is restricted to contain about 900 characters):
[DIRECT]
INDEXR1=matchstring1 matchstring2 matchstring3 ....
INDEXR2=matchstringn matchstringn+1
INDEXRn=etcetera
INDEXCn=fullword fullphrase etc
INDEXPn=partialword partialphrase etc.

[INTERFERE]
INDEXPn=partialword partialphrase etc.

[RANDOM]
RANDOM=randomanswer1 randomanswer2

Each matchstring, fullword/phrase and partialword/phrase refers to one or more answers, which are picked randomly by the dialogue handler, for instance:

[DIRECT]
INDEXR1=matchstring1 matchstring2 matchstring3 ....
matchstring1=1 2 3 4
matchstring2=5 6
matchstring3=7 8 9 1 3
INDEXR2=matchstringn matchstringn+1
matchstringn=10 5 9 12
matchstringn+1=11 12 7 9
etc.

Answers are stored in a separate answer .ini file (except for random answers which are in the main .ini file) like this:

[ANSWERS]
1=answer1-1 answer1-2 answer1-3...
2=answer2-1 answer2-2...
etc.

This gives very varied answers. First the dialogue handler picks a random answernumber from the main .ini file, then it picks a random answer from the answerfile belonging to that number.

I can also refer to answers in other groups, by using:

INDEXR2=matchstringn matchstringn+1
matchstringn=10+CHATROOM1 5+HELPDESK1 9+HELPDESK2 12+WORDGAME1

For second level dialogues I use a special .ini file which has about the same structure as the main .ini file. But in the special .ini file only words and phrases are stored that belong to a certain type of conversation. For instance, the dialogue handler picks an answer that contains a special code plus name for a second level dialogue, like in:

[ANSWERS]
123=answer123-1 answer123-2*KICK

I use this when somebody talks about a footballclub which is not the bot's favorite club. Answer123-1 could contain something like: "don't talk about that club". Answer123-2*KICK could contain: "you want to win an award? if not, stop talking :)". Then it would dive into the special KICK dialogue to find out whether the chatter keeps on nagging the bot. If so the chatter gets a chance to be kicked. Btw, there is a special timer which tells the event handler how long to stay in a second level dialogue, otherwise the bot would could get lost and never come out of it.

There is more to tell, but that would be too detailed.

As you can understand, this is not a self learning botscript, almost everything is predefined. I watched a lot of conversations between human chatters to find out what kind of matchstrings, words and phrases I should add to the bot. Most conversations are like: hello, how are you, how old are you (what is your age), what have you eaten (the bot will answer according to the actual time: in the morning he had a breakfast, in the afternoon lunch and in the evening some kind of hot dish), can I have a picture of you (I want a picture of you, please send me a picture), what is your favorite thing, where do you live (where do you come from), what are you doing now. My bot is capable of answering these kind of questions and ask meaningful questions too. But for a self learning bot you will need a kind of event and dialogue handler as described above plus an analyser that is capable of analyzing natural language. And such an analyser is very difficult to script. Also it would cost you a lot of time to learn the bot talking.

English is not my native language, I hope I made myself clear. Good luck!

Last edited by noMen; 18/09/07 10:15 AM.
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
ok can anyone tell me how to referance the last output I.e.
Code:
/msg $chan wait how much

I sent to a static value so I can use it as a piviot to a new responce
Code:
on *:text:$100:#: {
  if (%pretext == how much) {
    set %tk $rand(1,2)
    if (%tk == 1) { /msg $chan that is alot. }
    if (%tk == 2) { /msg $chan that is expensive. }
  else { /msg $chan how much }
  }
}

like using the last value as a topic in descussion.

Last edited by negeren; 20/09/07 11:17 PM.
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
I have tried the $recall and /recall to set it in the %pretext but not working

Joined: Jan 2006
Posts: 111
N
Vogon poet
Offline
Vogon poet
N
Joined: Jan 2006
Posts: 111
Ehmm .. I'm not sure that I understand what you mean, but I think you need something like this:

Code:
on *:text:$100:#: {
  if (%pretext == how much) {
    set %tk $rand(1,2)
    if (%tk == 1) { set %pretext that is a lot. }
    if (%tk == 2) { set %pretext that is expensive. }
    msg $chan %pretext
  }
}


But this is not the best way to have your bot talking, you will end up with dozens of on text events. And what to do if somebody says: $200? Or $1000?

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: negeren
ok can anyone tell me how to referance the last output


Your best option would be to use a hash table. Automatically store the last 2 lines of text from every person. When you get a new line from that person, it moves the last text to the second to last and then writes the new text. Hm... that's confusing... here's a visual example:
Quote:

Hash Table: SpokenText
Item=Data
Riamus.1=This is the last thing I wrote.
Riamus.2=This is what I wrote before what was written in Riamus.1.

Now, if I wrote "This is my new text.", it would look like this:
Quote:

Hash Table: SpokenText
Item=Data
Riamus.1=This is my new text.
Riamus.2=This is the last thing I wrote.


See how it moves the stuff around? That lets you look back at the last 2 things said in order to keep track of what's going on.

From there, you can have your bot set a variable whenever it asks a question. Something like %asked.Riamus = wait_how_much . I'd probably set the variable to automatically unset after a couple of minutes since the person isn't likely to respond after that and you don't want them to type something 2 hours later and you respond to them. Then when I type something new, you check for %asked.Riamus (obviously Riamus would be $nick) and see if it's set. If so, it will check what the variable is set to in order to know what question was asked. Then, you can call an alias that has the same name as the variable's data and it will check what was said by the nick and if it fits a given criteria (has to include a number in this case), it will respond appropriately based on the question.

The hash table is there so that you can easily look back and use part of what they said previously. Something like...
Quote:

Riamus: I made a lot of money today.
Bot: How much?
Riamus: $500
Bot: You made $500? That's a lot.

The blue is taken from the previous text, the red is taken from the latest text. It lets your bot sound more realistic. Of course, it's also more complicated making it valid, but if you want it to be realistic, that's your best option.

Don't forget to unset your %asked.nick variable after the bot replies.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2006
Posts: 14
N
negeren Offline OP
Pikka bird
OP Offline
Pikka bird
N
Joined: Sep 2006
Posts: 14
oooo hash tables ok I will try that. see I'm trying to convert some aiml files to msl and was trying to find a working substitute for the <that> command. this commad states that if a user says 100 then the bot responds how much. when the user says 100 the bot now responds wow that is expensive. or if the bod ask so what kind of job do you do. the user responds I'm a vet. the bot then asks questions about that job. but the hash tables should work I think.
ty

Page 1 of 2 1 2

Link Copied to Clipboard