Log in | Back to darenet.org

Topic Masking Guide

(Locking Your Topic)
 
(14 intermediate revisions not shown)
Line 1: Line 1:
-
Topic masks allow you to set a specific pattern that ChanServ will force all topics to follow. 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 feature.
+
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 substituted 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 wildcards 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 simplicity, and the purpose 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.
-
'''Now, let's take a look at an example.'''
+
===Example===
In Linux, to delete a file, you might execute the following command:
In Linux, to delete a file, you might execute the following command:
-
<code>rm OldNotes.*</code>
+
<code>rm notes.*</code>
-
In the example above, the system would delete all files called OldNotes that had any extension. Thus OldNotes,png, OldNotes.jpg, OldNotes.doc, OldNotes.txt and so on would be deleted. Therefore, the wildcard '''<code>*</code>''' essentially means anything, OldNotes.anything.
+
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 ==
+
==Setting your channel topic==
-
Now that we understand what wildcards are, and what they do, let's apply them to topic masking.
+
Now that we understand wildcards, let's apply them to topic masking. We'll start with an example.
-
Say, for example, we wanted our channel's topic to be:
+
We want to set the following topic in the channel #darenet:
-
<font color="red">'''<code>Welcome to the DareNET IRC Network's Main Channel. NEWS: Check out us out on the web @ <nowiki>http://www.darenet.org</nowiki></code>'''</font>
+
'''<code>Welcome to the DareNET lobby! NEWS: Like us on Facebook, http://www.facebook.com/darenet</code>'''
-
We would like to prevent everything before '''NEWS:''' from being changed, but allow anything to be added after it whenever someone uses ChanServ's TOPIC command. This is where topic masking comes in.
+
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:
-
To illustrate what we mean, here's an example:
+
<pre><NiTeMaRe> .topic Happy Holidays!
 +
* C changes topic to Welcome to the DareNET lobby! NEWS: Happy Holidays!</pre>
-
<pre> <SomeOp> .topic Welcome JoeCool to staff!
+
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.
-
* ChanServ changes topic to Welcome to the DareNET IRC Network's Main Channel. NEWS:  
+
Using C's SET TOPICMASK command, we set the following topic mask:
-
  Welcome JoeCool to staff!</pre>
+
-
Notice that the topic remained the same, except for the part after '''NEWS:''', which was replaced with what SomeOp typed. This method of topic alteration is what we refer to as topic masking. So, how did we acheive this? Well, we took advantage of the wildcard '''<code>*</code>''' to set our topic mask in the way that would satisfy our needs.
+
'''<code>/msg C SET #darenet TOPICMASK <font color="navy">Welcome to the DareNET lobby! NEWS: *</font></code>'''
-
Using ChanServ's SET command with the TOPICMASK option, we set the following topic mask:
+
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.
-
'''<code>.SET TOPICMASK Welcome to the DareNET IRC Network's Main Channel. NEWS: *</code>'''
+
===Topic snarfing===
-
Notice, we used the multi-character wildcard '''<code>*</code>''' after ''NEWS:'', which basically means allow anything here.
+
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.
-
== Locking Your Topic ==
+
To do this, use C's SET TOPICSNARF command. For example:
-
As the channel owner, you may notice that a certain level (200) and up by default can set your topic.  Lets say you want only 300 and up to be able to change your topic.
+
'''<code>/msg C SET #darenet TOPICSNARF 501</code>
-
To acheive this, issue the following command:
+
Now C will honor the topic mask whenever you change the channel topic.
-
'''<code>.SET ENFTOPIC 300</code>'''
+
==Confused?==
-
You have now set the enftopic (short for enforce topic) to 300.
+
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.
-
Your topic should now be locked, and using ChanServ's TOPIC command should put the given string (text) in the topic where your wildcard (*) was placed, as in our example earlier in this guide. You can view your current TOPICMASK and ENFTOPIC level by using ChanServ's SET command. For example, '''<code>.SET</code>'''
+
[[Category:All]] [[Category:Documentation]]
-
 
+
-
You may also want to set TOPICSNARF to 501 to prevent your DEFAULTTOPIC from being changed by anyone (including yourself) you can do this via the following command.
+
-
 
+
-
'''<code>.SET TOPICSNARF 501</code>'''
+
-
 
+
-
== Confused? ==
+
-
 
+
-
If you still aren't too sure on how topic masking works after reading this guide, that's okay! Our friendly support staff in #support will be more than happy to answer any questions you may have.
+
-
 
+
-
[[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.