[Request] Bot? |
Author: |
Message: |
mathieumg
Full Member
Posts: 181 Reputation: 2
35 / /
Joined: May 2004
|
RE: [Request] Bot?
According to that line "if(strUser != Messenger.MyName)", it should, but I did not test it.
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator
|
|
06-26-2006 12:16 PM |
|
|
Yomeh
New Member
Posts: 5
Joined: Jun 2006
|
RE: [Request] Bot?
Yeah it does work but can someone help me just wondering about the case select, because Case doesn't seem to work
|
|
06-26-2006 12:18 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: [Request] Bot?
I made a small script, you can edit the OnEvent_ChatWndReceiveMessage() function and replace the texts with whatever you want. But keep in mind: I converted the Message to lower case first so HeLLo and heLlO will both be parsed.
Enjoy!
Attachment: Bot.plsc (1.82 KB)
This file has been downloaded 198 time(s).
This post was edited on 06-26-2006 at 01:59 PM by Matti.
|
|
06-26-2006 12:52 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: [Request] Bot?
Yes, I'm sorry for not explaining how to get it working.
- Open a conversation with the person you want to be the bot from.
- Type and send the command /startbot to start the bot feature.
- Now, if the person says e.g. "Hi there!", you automaticly reply with "Hey (user)!" where (user) is the person who send you "Hi there!".
- This also works with "How are you?" and "Wazzup?", you will reply with the message "I'm fine! And how are you?"
- To stop the bot for this person, just type /stopbot. This will disable the bot from sending messages to this person, but will still work on other persons.
To add more automatic replies, add the following code:
code: var gotThanks = msg.indexOf("thanks");
var gotThnx = msg.indexOf("thnx");
var gotThankyou = msg.indexOf("thank u");
if(gotThanks != -1 || gotThnx != -1 || gotThankyou) {
ChatWnd.SendMessage("No problem, " + User + "! ;)");
}
or something likely at this location:
code: if(gotWhatsUp != -1 || gotWazzup != -1 || gotHowAreYou != -1) {
ChatWnd.SendMessage("I'm fine! :)\nAnd how are you?");
}
//Here the new code :)
}
I also updated the attachment, I left a small bug behind...
|
|
06-26-2006 01:49 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: [Request] Bot?
It seems like I forgot to place "= -1" behind some expression.
Try to download the new file, it now contains a menu in the chat window!
|
|
06-26-2006 02:02 PM |
|
|
-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
|
06-26-2006 02:22 PM |
|
|
segosa
Community's Choice
Posts: 1407 Reputation: 92
Joined: Feb 2003
|
RE: RE: [Request] Bot?
quote: Originally posted by -dt-
quote: Originally posted by Mattike
var gotThanks = msg.indexOf("thanks");
var gotThnx = msg.indexOf("thnx");
var gotThankyou = msg.indexOf("thank u");
if(gotThanks != -1 || gotThnx != -1 || gotThankyou) {
ChatWnd.SendMessage("No problem, " + User + "! ");
}
thats got to be the worst code Ive ever seen , even segosa wouldnt do that :--o.
* segosa slaps -dt-.
Anyway, I would even suggesdt making a txt file or something in the format
word1:word2:word3:wordN|reply
and parsing that, seeing if any of the words are in the msg and then replying with reply. (In fact that's the format I used for an autoresponder in mIRC script.)
The previous sentence is false. The following sentence is true.
|
|
06-26-2006 02:35 PM |
|
|
Matti
Elite Member
Script Developer and Helper
Posts: 1646 Reputation: 39
32 / /
Joined: Apr 2004
|
RE: [Request] Bot?
Hmm... never thought about that. Thnx -dt- and segosa!
|
|
06-26-2006 02:37 PM |
|
|
novolo
Junior Member
L2Luna GM
Posts: 67
– / /
Joined: May 2006
|
RE: [Request] Bot?
Instead of doing the msg.match thing like in here..
code: if(msg.match(/thanks|thnx|thank u/)){
ChatWnd.SendMessage("No problem, " + User + "! ");
}
isn't there a way like: msg.contains or something like that?
because if we use msg.match, me message recieved has to be exactly like that, instead is it contains certain words we can gues what he's talkiing about and return something close...
any ideas?
|
|
06-26-2006 04:35 PM |
|
|
Plik
Veteran Member
Posts: 1489 Reputation: 46
35 / / –
Joined: Jun 2004
|
RE: [Request] Bot?
quote: Originally posted by novolo
Instead of doing the msg.match thing like in here..
code: if(msg.match(/thanks|thnx|thank u/)){
ChatWnd.SendMessage("No problem, " + User + "! ");
}
isn't there a way like: msg.contains or something like that?
because if we use msg.match, me message recieved has to be exactly like that, instead is it contains certain words we can gues what he's talkiing about and return something close...
any ideas?
Erm match does test if the message contains the words.
match is is a regexp function
|
|
06-26-2006 05:09 PM |
|
|
Pages: (3):
« First
«
1
[ 2 ]
3
»
Last »
|
|