CodeBase
New Member
- Joined
- Apr 6, 2011
- Messages
- 63
- Reaction score
- 0
AutoAnswer
Hello Everybody,
Welcome to my new plugin called AutoAnswer. This plugin will automatic reply to a whisper you get. This is not a plugin where you have some answers and it will choose only one or so, with this plugin you will be able to define your own answers for a whisper. Let me explain it a little bit.
You got a whisper from a player: "Hello how are you". So what will you answer to this whisper ? Maybe "Hi i'm fine" or "Hello i feel great" so which of will you send to the player ? With this plugin you could define a list of answers which are Possible to send. I will go in to deep now.
We have define two parts in our plugin:
1) "Hello how are you"
2) "Hello are you fine"
so a new whisper will come with this context: "Hello feel you fine".
So oh shit we have not defined this in your Plugin. So the plugin will calculate which of the two we defined matches more to the real Whisper (We could have more definitions this is just an example how the mechanism is working).
Number 1 will match the real whisper with 50% and number 2 will match with 75% so one of the answers of number 2 will choosen. I hope this is clear for the moment.
So have a look at the definition:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<Definition>
<Section name="Default">
<Message></Message>
<AnswerList>
<Answer level="0">
<WriteBackMessage delay="2500">Leave me alone please i just want to level</WriteBackMessage>
<WriteBackMessage delay="1800">please leave me alone</WriteBackMessage>
</Answer>
<Answer level="1">
<WriteBackMessage delay="3200">i said i dont want to write with you</WriteBackMessage>
<WriteBackMessage delay="1200">go away</WriteBackMessage>
</Answer>
<Answer level="2" ignore="true" acceptinvite="false">
<WriteBackMessage delay="1600">Good bye</WriteBackMessage>
</Answer>
</AnswerList>
</Section>
<Section name="ID1">
<Message>Hello how are you</Message>
<AnswerList>
<Answer level="0">
<WriteBackMessage delay="2500">I feel fine thanks</WriteBackMessage>
<WriteBackMessage delay="2200">Great thanks</WriteBackMessage>
<WriteBackMessage delay="2700">Awesome</WriteBackMessage>
<WriteBackMessage delay="2100">Very good</WriteBackMessage>
</Answer>
<Answer level="1">
<WriteBackMessage delay="3200">Leave me alone please</WriteBackMessage>
<WriteBackMessage delay="1200">-.-</WriteBackMessage>
</Answer>
<Answer level="2" ignore="true" acceptinvite="false">
<WriteBackMessage delay="1600">Leave me ALONE please and welcome on Ignore</WriteBackMessage>
</Answer>
</AnswerList>
</Section>
<Section name="ID2">
<Message>Hello are you fine</Message>
<AnswerList>
<Answer level="0">
<WriteBackMessage delay="2500">I feel fine thanks</WriteBackMessage>
<WriteBackMessage delay="2200">Great thanks</WriteBackMessage>
<WriteBackMessage delay="2700">Awesome</WriteBackMessage>
<WriteBackMessage delay="2100">Very good</WriteBackMessage>
</Answer>
<Answer level="1">
<WriteBackMessage delay="3200">Leave me alone please</WriteBackMessage>
<WriteBackMessage delay="1200">-.-</WriteBackMessage>
</Answer>
<Answer level="2" ignore="true" acceptinvite="false">
<WriteBackMessage delay="1600">Leave me ALONE please and welcome on Ignore</WriteBackMessage>
</Answer>
</AnswerList>
</Section>
<Section name="ID3">
<Message>You are a bot</Message>
<AnswerList>
<Answer level="0">
<WriteBackMessage delay="2500">No i'm not</WriteBackMessage>
<WriteBackMessage delay="2700">O_O you are crazy</WriteBackMessage>
</Answer>
<Answer level="1">
<WriteBackMessage delay="3200">Let me alone</WriteBackMessage>
<WriteBackMessage delay="3500">go away</WriteBackMessage>
</Answer>
<Answer level="2" ignore="true" acceptinvite="false">
<WriteBackMessage delay="3200">Welcome on ignore</WriteBackMessage>
</Answer>
</AnswerList>
</Section>
</Definition>
So what we see here. We have 3 definitions and one default. Please notice that the default should only be defined ones but it should be defined in one of the files you are including. So have a look at the Definition ID3. There are 3 levels of answers (you could define more or less there is no limit) so what does it mean ? If you got an whisper which is matching with "You are a bot" one of the WriteBackMessage's from the answer level=0 will be choosen (index should always start with 0). The delay means how long the plugin should wait to send the answer back (it will look more humanlike if you got answers after some seconds).
So what does level=1 means ?:
If you got the same whisper or an whisper wich is matching with "You are a bot" again the plugin will choose one of the WriteBackMessage's at level=1. The last part will be level=2 there are two flags you could set (acceptinvite is not working in this version but it will come), if you set ignore="true" the player will get on the ignorelist after sending one of the WriteBackMessage's which are defined back to him.
For understanding: You dont have to define always three levels you could also define just one or two or hundred it is up to you how many you will define.
I hope you understand it.
So what does the defaultpart. The defaultpart will be choosen if non of the other parts will match more then 5%. Please let the field Message empty in the defaultpart. Just the the writebackmessage's.
If you got one xml file just copy it under "Settings\Include" and the plugin will load it when you disable/enable it again.
If anybody will write some of this definitionfiles let me know i will post it here, so we could share files and making the whisperback more humanlike.
how to Install:
Just copy the folder under "HonorBuddy\Plugins\", open the buddy, goto plugin and recompile all. After that pease restart the buddy. After restart goto plugin again and enable the plugin.
There is also an example xml in the folder so you could see how does it work
If there are any question just ask

here it is:
View attachment AutoAnswer_V1.0.0.zip
I'm also working on an application which will make definitioncreation much easier to handle. it will come maybe today i will see
Regards
chris
Last edited: