Log in | Back to darenet.org

Topic Masking Guide

(Wildcards)
(Setting your channel topic)
Line 22: Line 22:
==Setting your channel topic==
==Setting your channel topic==
-
Now that we have a firm grasp of 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.
-
Let's say we wanted to set the following topic on channel #darenet:
+
We want to set the following topic in channel #darenet:
-
<font color="navy">'''<code>Welcome to the DareNET IRC Network's Main Channel. NEWS: Like us on Facebook, http://www.facebook.com/darenet</code>'''</font>
+
'''<code>Welcome to the DareNET lobby! NEWS: Like us on Facebook, http://www.facebook.com/darenet</code>'''
-
However, we would also like to prevent everything before '''NEWS:''' from being changed, but allow anything to be added after it whenever someone uses ChanServ's TOPIC command. We can easily do this by using topic masking.
+
However, we also want to be able to update what follows "NEWS:" without having to retype everything 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 help illustrate what we mean, here's an example:
+
<pre><NiTeMaRe> .topic Happy Holidays!
<pre><NiTeMaRe> .topic Happy Holidays!
-
* ChanServ changes topic to Welcome to the DareNET IRC Network's Main Channel. NEWS: Happy Holidays!</pre>
+
* ChanServ changes topic to Welcome to the DareNET lobby! NEWS: Happy Holidays!</pre>
-
Notice that our topic remained the same, except for the part after '''NEWS:''', which was replaced with what NiTeMaRe typed. This method of topic alteration is what we refer to as topic masking. Cool, right? So how did we achieve this? Well, we took advantage of the wildcard '''*''' to set our topic mask in the way that would satisfy our needs.
+
You'll notice only the part after "NEWS:" changed from our original topic, which was replaced with that 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 ChanServ's SET TOPICMASK command, we set the following topic mask:
Using ChanServ's SET TOPICMASK command, we set the following topic mask:
-
<code>/msg ChanServ SET #darenet TOPICMASK Welcome to the DareNET IRC Network's Main Channel. NEWS: *</code>
+
'''<code>/msg ChanServ SET #darenet TOPICMASK <font color="navy">Welcome to the DareNET lobby! NEWS: *</font></code>'''
-
Notice that we used the multi-character wildcard '''*''' after ''NEWS:'', which lets ChanServ know to allow anything here.
+
Notice that we used the asterisk ('''*''') wildcard after "NEWS:". This tells ChanServ to allow anything here, substituting it with whatever we supply with the TOPIC command.
==Locking Your Topic==
==Locking Your Topic==

Revision as of 22:25, 11 March 2012

Topic masks allow you to force topics to follow a set pattern. To effectively use ChanServ'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. ChanServ 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 exceptions, 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; thereofre, 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 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 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!
* ChanServ 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 that 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 ChanServ's SET TOPICMASK command, we set the following topic mask:

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

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

Locking Your Topic

As the channel owner, you may have noticed that users on the channel's userlist with an access level of at least 200 can change the channel's topic. You can change the minimum access level needed to change a channel's topic by using ChanServ's SET ENFTOPIC command.

Let's say we wanted to restrict topic changes to those with an access level of 300 or above on #darenet, we would use the following command:

/msg ChanServ SET #darenet ENFTOPIC 300

Now ChanServ will only allow those with an access level of at least 300 on #darenet to change the topic. Whenever one of them uses ChanServ's TOPIC command, ChanServ will substitute the given string (text) in the topic where our wildcard was placed, as shown in our earlier example.

You can view the current topic mask and enforce topic level for a channel by using ChanServ's SET command.

Topic snarfing

As the channel owner, you may have noticed that even though you set a topic mask for your channel, changing your topic still replaces the entire message. This is because ChanServ grants you override for changing the topic, allowing you to change it in its entirety. To prevent this, you must tell ChanServ that you do not want to override the topic mask.

To achieve this, you must set the TOPICSNARF level for the channel to one higher than your own, such as 501. You can do this by using: .SET TOPICSNARF 501

Confused?

If you still aren't too sure on how topic masking works after reading this guide, that's okay! Our support staff in #support will be more than happy to answer any questions you may have.