Log in | Back to darenet.org

Topic Masking Guide

m (sp)
 
(23 intermediate revisions not shown)
Line 1: Line 1:
-
Topic masks allow you set a specific pattern that ChanServ will force all topics to match. However, before we go further into detail, let's talk about wildcards as you will need a firm understanding of them to effectively use ChanServ's topic masking option.
+
Topic masks allow you to force topics to follow a set pattern. To effectively use C's topic masking feature, you'll need a firm understanding of "wildcards", which we'll discuss in the next section of this guide.
-
== Wildcards ==
+
==Wildcards==
-
A wildcard is a character that may be subsititued for any of a defined subset of all possible characters. Whether the wildcard character represents a single character or a string of characters must be specified.  
+
The great Wikipedia defines a wildcard as ''a character that may be substituted for any of a defined subset of all possible characters''. In other words, the wildcard acts as a place holder. It'll be substituted for any other character or several characters. C supports two wildcards:
-
A multi-character wildcard is defined by the '''<code>*</code>''' character, while a single-character wildcard is defined by the '''<code>?</code>''' character.
+
* '''*''' - (asterisk) - substitutes for zero or more characters
 +
* '''?''' - (question mark) - substitutes for one character
-
These wildcards operate in the same fashion as they did in DOS or Unix, if you remember using them in either of these environments. Likewise, if you have ever used them in channel bans, it is essentially the same concept.
+
These two wildcards operate in the same fashion as they did in DOS or UNIX, if you have used them in either of these environments. Likewise, if you have ever used wildcards in channel bans or exemptions, same concept.
-
For the purposes of this guide, we will only be concerned with the multi-character wildcard (*).
+
To keep things simple, we will only use the asterisk "'''*'''" wildcard in this guide.
-
In Linux, to delete a file, you might execute the command:
+
===Example===
-
<code>rm OldNotes.*</code>
+
In Linux, to delete a file, you might execute the following command:
-
In the above example, the system would delete all files called OldNotes that had any extension. Thus OldNotes.jpg, OldNotes.doc, OldNotes.txt and so on would be deleted. Therefore, the wildcard '''<code>*</code>''' essentially means anything, OldNotes.anything.
+
<code>rm notes.*</code>
-
== Setting Your Channel Topic ==
+
The above command would delete all files called "notes", regardless of extension. Thus, notes.png, notes.txt, notes.pdf, notes.doc, etc. would all be deleted; therefore, the asterisk ('''*''') wildcard essentially means anything, notes.anything.
-
Now that we understand what wildcards are, and what they do, let's set our channel's topic. Let's say we wanted our topic to be the following:
+
==Setting your channel topic==
-
'''<code>Welcome to the DareNET IRC Network Main Channel - <nowiki>http://www.darenet.org/</nowiki> - Join #Support for channel registration and/or staff assistance - NEWS: Updated features coming soon!</code>'''
+
Now that we understand wildcards, let's apply them to topic masking. We'll start with an example.
-
Our goal here is to have the topic always remain the same, but allow the part that comes after "NEWS:" to be changed when we issue the <code>.topic</code> command.
+
We want to set the following topic in the channel #darenet:
-
For example, if we issued the following command:
+
'''<code>Welcome to the DareNET lobby! NEWS: Like us on Facebook, http://www.facebook.com/darenet</code>'''
-
<code>.topic Welcome JoeOper to staff!</code>
+
However, we also want to be able to update what follows "NEWS:" without having to retype everything that comes before it every time we change the topic with exciting new information. Topic masking makes this easy! In other words, we want to be able to do something like:
-
The topic will change to:
+
<pre><NiTeMaRe> .topic Happy Holidays!
 +
* C changes topic to Welcome to the DareNET lobby! NEWS: Happy Holidays!</pre>
-
'''<code>Welcome to the DareNET IRC Network Main Channel - <nowiki>http://www.darenet.org/</nowiki> - Join #Support for channel registration and/or staff assistance - NEWS: Welcome JoeOper to staff!</code>'''
+
You'll notice only the part after "NEWS:" changed from our original topic, which was replaced with what NiTeMaRe typed. This method of topic alteration is what we call topic masking. Cool, right? So how did we achieve this? By taking advantage of wildcards -- the asterisk ('''*''') wildcard to be exact.
-
Notice what we typed after <code>.topic</code> was added after "NEWS:". This method of topic alteration is what we refer to as topic masking. So, how do we achieve this? Well, we can take advantage of the wildcard '''<code>*</code>''' to set our topic mask in the way that would satisfy our needs.
+
Using C's SET TOPICMASK command, we set the following topic mask:
-
To achieve the above example, we would use the <code>.set topicmask</code> command to set the following topic mask:
+
'''<code>/msg C SET #darenet TOPICMASK <font color="navy">Welcome to the DareNET lobby! NEWS: *</font></code>'''
-
<code>.set topicmask Welcome to the DareNET IRC Network Main Channel - <nowiki>http://www.darenet.org/</nowiki> - Join #Support for channel registration and/or staff assistance - NEWS: *</code>
+
Notice that we used the asterisk ('''*''') wildcard after "NEWS:". This tells C to allow anything here, substituting it with whatever we supply with the TOPIC command.
-
== Locking Your Topic Mask==
+
===Topic snarfing===
-
As the channel owner, you may notice that even though a topic mask is set for your channel, changing your topic still replaces the entire message. This is because ChanServ grants the channel owner override for changing the topic, which allows you to change it in its entirety. However, this a way around this!
+
There is one small "gotcha" to be aware of. By default, C will ignore the topic mask when channel owner's change the topic, replacing the entire topic. You can prevent this by telling C you do not want to override the topic mask by changing the channel's TOPICSNARF level to one higher than your own, such as 501.
-
As channel owner, you can tell ChanServ that you do not want to override the topic mask, that you in fact want to always use the wildcard.
+
To do this, use C's SET TOPICSNARF command. For example:
-
To do this, we would issue the following command:
+
'''<code>/msg C SET #darenet TOPICSNARF 501</code>
-
<code>.set enftopic 501</code>
+
Now C will honor the topic mask whenever you change the channel topic.
-
Now, we chose to set enftopic (short for "enforce topic") to 501 because as owner of the channel, you have an access level of 500. Since we always want to use the topic mask, we set enftopic to an access level higher than ourselves, so it will always be used. This will keep the topic in tact, and only allow us to change the wildcard section of the topic mask (*).
+
==Confused?==
-
Your topic should now be locked, and any <code>.topic</code> command should put the given string (text) in the topic where your wildcard (*) was placed, as in our example used earlier in this guide.
+
If you still aren't quite sure how topic masking works after reading this guide, that's okay. Stop by [http://webchat.darenet.org?channels=help #help] where we'll be more than happy to answer any questions you may have.
-
You see your current topic mask and enftopic level by using the <code>.set</code> command in your channel.
+
[[Category:All]] [[Category:Documentation]]
-
 
+
-
== Changing Your Topic Mask ==
+
-
 
+
-
Before you can change your topic mask (by using the steps shown above), we must first change our enftopic level back to at least 500. Once we have done so, we can then safely change the topic mask. When we're through, we can then set enftopic back to 501.
+
-
 
+
-
== Confused? ==
+
-
 
+
-
If you are still unsure on how to topic masking operates, feel free to stop by #support and ask. Our support staff will be more than happy to help to you.
+
-
 
+
-
[[Category:Documentation]]
+

Current revision as of 17:16, 11 October 2012

Topic masks allow you to force topics to follow a set pattern. To effectively use C's topic masking feature, you'll need a firm understanding of "wildcards", which we'll discuss in the next section of this guide.

In This Guide:

Wildcards

The great Wikipedia defines a wildcard as a character that may be substituted for any of a defined subset of all possible characters. In other words, the wildcard acts as a place holder. It'll be substituted for any other character or several characters. C supports two wildcards:

  • * - (asterisk) - substitutes for zero or more characters
  • ? - (question mark) - substitutes for one character

These two wildcards operate in the same fashion as they did in DOS or UNIX, if you have used them in either of these environments. Likewise, if you have ever used wildcards in channel bans or exemptions, same concept.

To keep things simple, we will only use the asterisk "*" wildcard in this guide.

Example

In Linux, to delete a file, you might execute the following command:

rm notes.*

The above command would delete all files called "notes", regardless of extension. Thus, notes.png, notes.txt, notes.pdf, notes.doc, etc. would all be deleted; therefore, the asterisk (*) wildcard essentially means anything, notes.anything.

Setting your channel topic

Now that we understand wildcards, let's apply them to topic masking. We'll start with an example.

We want to set the following topic in the channel #darenet:

Welcome to the DareNET lobby! NEWS: Like us on Facebook, http://www.facebook.com/darenet

However, we also want to be able to update what follows "NEWS:" without having to retype everything that comes before it every time we change the topic with exciting new information. Topic masking makes this easy! In other words, we want to be able to do something like:

<NiTeMaRe> .topic Happy Holidays!
* C changes topic to Welcome to the DareNET lobby! NEWS: Happy Holidays!

You'll notice only the part after "NEWS:" changed from our original topic, which was replaced with what NiTeMaRe typed. This method of topic alteration is what we call topic masking. Cool, right? So how did we achieve this? By taking advantage of wildcards -- the asterisk (*) wildcard to be exact.

Using C's SET TOPICMASK command, we set the following topic mask:

/msg C SET #darenet TOPICMASK Welcome to the DareNET lobby! NEWS: *

Notice that we used the asterisk (*) wildcard after "NEWS:". This tells C to allow anything here, substituting it with whatever we supply with the TOPIC command.

Topic snarfing

There is one small "gotcha" to be aware of. By default, C will ignore the topic mask when channel owner's change the topic, replacing the entire topic. You can prevent this by telling C you do not want to override the topic mask by changing the channel's TOPICSNARF level to one higher than your own, such as 501.

To do this, use C's SET TOPICSNARF command. For example:

/msg C SET #darenet TOPICSNARF 501

Now C will honor the topic mask whenever you change the channel topic.

Confused?

If you still aren't quite sure how topic masking works after reading this guide, that's okay. Stop by #help where we'll be more than happy to answer any questions you may have.