[Metis] User Groups

Discuss all kinds of software here including apps, games and operating systems. You can also share software guides and receive help for your software in this section.
User avatar
Pri
Site Admin
Site Admin
Posts: 5433
Joined: Fri Dec 14, 2007 8:59 am

[Metis] User Groups

Tue Dec 18, 2007 3:20 pm

The main way that people keep there scripts locked down, that is to say work for only the people they want it to work with is by making Usergroups.

So in this guide we will show you how to make a functional usergroup.
To start with you need to collect the names of the people you want to be in the usergroup.
For our guide we will use John, David, Steve, Bob and Joe

There are a few ways to specify how the Usergroup will lock on to the person in question. We will show 5 different ways.

So to start with lets create the usergroup brackets. Open your MXC.xml and before the line that says </config> insert this

Code: Select all

<usergroup name="friends" case="0">
</usergroup>
Now between these tags you put the names. Like so

Code: Select all

<usergroup name="friends" case="0">
John
*David
Steve*
*Bob*
*joe*
</usergroup>
Now you may have noticed that in our tag we added some stars. These are known as "Wild Cards" and it allows you to specify how it will lock on. Now this is where it gets a little complicated to understand how to use these properly so we will give an example for each one.

The Entries:
John - Now notice John does not have any Stars, this means the name of the person must be exactly the same as the one in the usergroup.
*David - David has a star at the front which means the name can be like this XYZDavid and it would still know it's David.
Steve* - Steves star is at the end so that means his name has to start with Steve but he can have anything after it like SteveXYZ and it will still know its Steve.
*Bob* - Bob has 2 stars which means aslong as he has Bob somewhere in his name (No mater where) it will know its him. his name could look like so: XYZBobXYZ and it would still know its him.

And finally we have joe, You may notice his J is not a capital letter. Why is that? Well in our top tag we have the following:

Code: Select all

<usergroup name="friends" case="0">
The case="0" means that none of the names in that usergroup are Case sensitive. So if a user like joe enters as JoE or JOE or any combination it will still pick him up. The same goes for all the other names. If you want it to be Case Sensetive then change the 0 to 1. (In computers, 0 means off and 1 means on)

So now that you have made the usergroup and set your wild cards lets put the Usergroup to use in a Hello World script. Very simple.

Code: Select all

<usergroup name="friends" case="0">
John
*David
Steve*
*Bob*
*joe*
</usergroup>

<command type="script" usergroup="friends">
<in>hi</in>
<out>Hello World!</out>
</command>
You notice we added the usergroup to the Command Type: "<command type="script" usergroup="friends">" this activates the usergroup for that command.

So our users come in the room and lets see how it looks:

John: hi
BOT: Hello World!
XYZDavid: hi
BOT: Hello World!
SteveXYZ: hi
BOT: Hello World!
XYZBobXYZ: hi
BOT: Hello World!
JOE: hi
BOT: Hello World!

All working great, now lets try it with a user who is not in the usergroup:

Jason: hi

And no response, as Jason is not in the Usergroup anywhere. The bot does not reply.

And that is the basics of creating a usergroup. You may post questions in this topic.
Kinglouie
Member
Member
Posts: 3
Joined: Wed Oct 27, 2010 3:38 pm

Re: [Metis] User Groups

Fri Sep 16, 2011 9:42 pm

Can you make the bot display a different message to someone not in a usergroup?

Return to “Software Centre”

Who is online

Users browsing this forum: No registered users and 9 guests