----------------UNeed Script AI Documentation----------------

1) Received Messages

Received Messages Are Processed And Recognized Using Mainly 2 Commands , We Will Discuss Both In The Following Sections

	a) [Cmd]-[Starting=Pos] + Examples

The cmd command is used for messages if their position is known , cmd used by itself will check if the message received is equal to
the value specified in CMD. 
Example: [cmd]!menu[/cmd] , the AI will check if the received message is !menu , and nothing else and if it
is , will execute the reply section.

The Starting field comes to remove the limitations of the cmd command because by using it , you can specify the position where to
start looking for the text in cmd , no matter what is found elsewhere , if at that position the text is found , the AI will execute the reply section.
Example: [cmd][starting=0]!say [/cmd] , The AI will see if at the position 0 , the text "!say " is found , the rest is ignored.

	b) [Contains] + Examples

The contains command is here to be able to reply to messages which contain the field given by it. As it's name suggests It will check if
the message contains the string , if yes it will execute the reply section.
Example: [contains]Omg![/contains]

	c) Handling Multiple Messages

It is very easy to have several messages return the same reply by using the seperator character *
No Need to Redo everything all over again , just use * to seperate your received messages in both cmd or contains fields.
Example: [contains]hi*hello*howdy*yo*sup[/contains]

NOTE: The * seperator can also be used in Replies with Rand Operator.

2) Replies

The Reply Field is the only one used for replies , yet it is extremely customisable to comply with the needs of the person using it

	a) [Reply] + Example

Here is an example of a simple reply command:
[reply]Why????[/reply]

	b) [Rand] + Example

The Rand operator was mainly made to choose between random replies each seperated by *.
Example:
[rand]What?*Really?!!*You're Kidding Me[/rand]

	c) Handling Received Messages In Reply

		i) Seperation By " " (Space)

To help the coder , The script provides the access to each part of the message seperated by a space using the following command:
$(Index) or $(A - Index) or simply $(A)
Index : The index found when seperating by space , example: "what are you doing?" , the index of "you" in this message is 2, there are 2 spaces before it,
A : A represents the word ALL , and it implies all fields , for example $(A) returns the whole message, $(A-Index) returns the message deprived
of the parts before the indexed text, for example $(A-1) return the whole message without the first part , before the first space.

		ii) From To Destination Operator

You can also get parts of received messages using the From-To Operator in the following manner:
$(FromToDest) , From And Dest are respectively the starting postion and ending position of the part you want to use.
Character "E" can be used to imply the End of the text.
Examples: $(0To15) , $(5ToE)

	d) Variables You Can Use

For more customizations , UNeed provides access to a good number of variables, you can use in the reply field:
$nick - The nickname of the contact that sent you the message
$email - The email address of the contact that sent you the message
$status -  The status of the contact that sent you the message
$psm - The personal message of the contact that sent you the message
$cmedia - The now playing field(media) of the contact that sent you the message
$mynick - Your nickname
$myemail - Your email address
$mystatus - Your status
$mypsm - Your personal message
$mycmedia - Your media fields

Example: [reply]My nick is: $nick[/reply]

	d) Commands You Can Call

Along with the variables , UNeed gives access to several commands you can execute:

/$chgnick['New Nickname Here']/ - Changes your nickname to the one you put between quotes, a variable from a received message can be used too.

Full Example Of A Nickname Change Script: 
[start]
[cmd][starting=0]!nick [/cmd]
[reply]/$chgnick['$(A-1)']/Nickname has been changed to: $(A-1)[/reply]

/$chgpsm['New PSM Here']/ - Changes your personal message to the one provided between the single quotes

/$chgstatus['Status Number Here']/ - Changes your status to any of the ones below.
Available Status Numbers:
2 - Appear Offline 
3 - Online 
4 - Busy 
5 - Be Right Back 
6 - Idle 
7 - Away 
8 - In a Call 
9 - Out to Lunch 

/$sendfile['File Path Here']/ - Sends a file to the contact that sent you the message.

/$invite['Email Here']/ - Invites the email provided between the single quotes to the conversation.

3) Start Operator

Each Cmd or Contains + Reply Commands must be preceded by the start operator to let the script know that it should look again for the commands given.
Not putting the start operator will result in your commands not being processed. Example:

[start]
[cmd]...[/cmd]
[reply]??[/reply]
[start]
[contains] AI[/contains]
[reply]YEAAA!!![/reply]

NOTE: Some examples can be found in the AI Script that comes with the documentation , see that if you didn't quite get the documentation

----------------	END		----------------