Lets get started.
1. Editing your MXC.
To start creating you need to open your mxc.xml
So lets get an editor, some suggestions:
Windows Notepad (Included with Windows)
Programmers Notepad http://www.pnotepad.org/download/ (Free)
Notepad 2 http://www.flos-freeware.ch/notepad2.html which is my Personal Choice (Also Free).
2. Learning the Fundamentals
The first script you will make is one called Hello World. Its the notorious first program anyone ever writes when learning a new computer language so thats what we will be teaching.
Move down in your MXC just before the line that says </config> and write the following:
Code: Select all
<command>
<in>hi</in>
<out>Hello World</out>
</command>
Let's create a Text recorder instead.
Code: Select all
<command type="script">
<in>hi %PARAM%</in>
<out>Hello World</out>
<out>%PARAM%</out>
</command>
So this is how it will look in your room
USER: hi everyone
BOT: Hello World
BOT: everyone
So lets mix it up a bit!
Code: Select all
<command type="script">
<in>hi %PARAM%</in>
<out>Hello %PARAM%</out>
</command>
USER: hi everyone
BOT: Hello everyone
And that is the Fundamentals of writing basic scripts. But to make things that have many more features you need better information retention. Being able to hold many responses in different areas for later retrival is the foundation of practically every bot script.
There are two terms I should explain at this point. Pushing and Popping. When you push data you are moving it from one area to another area. Pretty simple if a user types a message, you can push that message in to a user varible which is stored and can later be accessed. And Popping is when you forcefully wipe that user varible. You can overwrite a user varible by pushing new data in to it or by popping it.
So lets give an example.
Code: Select all
<command type="script">
<in>hi %PARAM%</in>
<out type="push" extdata="store1">%PARAM%</out>
<out>The user param: "$store1$" has been stored.</out>
</command>
USER: hi everyone
BOT: The user param: "everyone" has been stored.
Lets experiment with a few ways you can store data (There are many).
Code: Select all
<command type="script">
<in>hi %PARAM%</in>
<out type="push" extdata="store1">%PARAM%</out>
<out type="push" extdata="store2">HELLO</out>
<out type="push" extdata="store3">I'm a bot!</out>
<out>The user param: "$store1$" has been stored.</out>
<out>$store2$</out>
<out>$store3$</out>
<out>All together: $store2$ $store1$ $store3$</out>
</command>
USER: hi everyone
BOT: The user param: "everyone" has been stored.
BOT: HELLO
BOT: I'm a bot!
BOT: All together: HELLO everyone I'm a bot!
Now in our example we used store1 store2 etc but you can type anything you want for a uservarible. For instance:
Code: Select all
<command type="script">
<in>hi %PARAM%</in>
<out type="push" extdata="david">%PARAM%</out>
<out type="push" extdata="RED">HELLO</out>
<out type="push" extdata="huh">I'm a bot!</out>
<out>The user param: "$david$" has been stored.</out>
<out>$RED$</out>
<out>$huh$</out>
<out>All together: $RED$ $david$ $huh$</out>
</command>
And there you have it the Fundamentals of Bot Creation. You can post questions in this topic including help requests.