IRC Script Concepts

Active scripts

This is a list of scripts that I have been or am currently developing.

Join and Part message filter (Essentially Complete)

This script is an adaptation of the Smart Filter by ghospich I found on github. It filters out join and leave messages from the visible chat, except when needed. The original script kept track of usernames when logging in and leaving. If a user spoke, it would add information to the first message, indicating how long ago they entered the chatroom. Furthermore, once a user has spoken, it will display the following join and leave messages for them.

The problem I had with this script was based on the usage of usernames. Under certain circumstances, a user may return to an IRC channel using a different name. This is fairly easy to identify via the host information in the join message, but if the join is not displayed, this cannot be directly inferred. To correct this, I adapted the filter to keep track of users by their host information instead of username, which provides more accurate filtering. In addition to this, I’ve added support to explicitly identify if a user has changed their name. If they join under a different name, instead of displaying the time they joined, it will display a message indicating their previous username.

This script is essentially complete, at least to my satisfaction. There may still be the odd bug existing in it, though none that I’ve noticed to be significant.

I’ve recently been adding to this script, with changes including IP address resolving, to recognize identical users when their host name changes. I’ve also added built-ip geo-ip identification, which can optionally append a user’s country and region location information to the join message. Finally, I’ve added toggles for these settings, with persistent configurations between plugin loading.


*.net *.split filter (Could probably use some work)

On the Esper.Net network, and likely others, if one of the servers becomes unavailable, any users hosted on it are disconnected, flooding channels with part messages resembling: cubethethird has quit(*.net *.split)

To clean this up, I’ve written a script that hides these messages, and displays a single notification indicating that a Net Split has occurred. This is followed by a 2 second time-out before another notification is displayed, to avoid unneeded repetition.

The script could probably use some work, particularly since it hides part messages, regardless of who left. I may add functionality in the future to display a list of users who quit, or something similar.


Slack filter (No longer in development)

Slack, which is a team communication service, has an IRC connection option that I use. It does the trick, though it’s not perfect. One of problems I have with it, is the way it handles user availability. It “announces” when people are present or away by giving and removing Voice in the channels. This quickly builds up and floods the chat. I decided to make a script to remove all voice messages from Slack to clean these up. This aspect of the script is complete, though I expect I will add more to improve it (better handling of emoticons for example).

As I no longer use slack via IRC, I currently have no interest in continuing the development of this script.


Name Colouring Script (Complete)

By default, HexChat Assigns pseudo-random colours to usernames (or nicks) in IRC, colouring them when users speak. It does not, however, colour the names anywhere else, such as in chat messages. This script colours names in chat messages, provided they are found in the same channel as the message, using the same colouring scheme that HexChat uses. In order to avoid ambiguous circumstances, Regular Expressions are used to identify when usernames are being used, and which name to choose. At present the script seems to work well, and I think I’ve squashed most of the bugs. The only major problem is the way it removed colour. Currently, it sets the colour back to default, but this always defaults to white. I am not sure if this is a bug with HexChat, or if I will need to add special cases for message highlighting, and when the host is speaking vs someone else.

Update: I’ve worked around the colour issue by using a new script, as follows.


Colour Fixing Script (Needs work)

This script corrects incorrect colours set when “disabling” colours. An example of this is if a portion of a chat message is coloured. The non coloured portions should use the default text colour, or the highlighted colour if the user is being pinged. Instead, white (default colour) is used after colouring is removed. This script corrects this. Currently, it inserts the correct colour code, replacing the white value with the default or highlight text colour. In the future, I plan to make it more adaptive, and set the colour to the previous colour in the message, if one exists.

 

Script ideas

The following are some ideas I’ve jotted down about possible scripts to make in the future.

  • Translator script

    • Automatically detect if the message is in a different language, and output the translated message into the native (or English?) language
    • Could be problematic, as it would likely require querying a translation service for every message
    • Would need either a proper public API for translating (usage limit could be an issue)
      • Could alternatively try parsing the output from an HTML query
  • Spam response script

    • Automatically perform action (kick or ban for example) if a user spams a chatroom
      • Cases of usage such as a user typing out a multitude of other usernames, to ping spam them
    • Would require pattern identification, such as scanning each message for a certain amount of usernames
    • May need to check the client’s permission in the afflicted channel
  • PM (Private Message) script

    • Automatically respond to private messages
      • Possibly user-specific responses, depending on factors like away status, and in what channels the user is found
    • Automatically add users to ignore list
      • Probably only do this if user sends too many private messages (within a certain time frame?)
      • Option to temporarily or permanently ignore the user
    • Script may possibly conflict with intended private messaging
      • Have some kind of whitelist for names and/or channels

I’m open to suggestions left as comments here as well, though I can’t say if and when I will get to these ideas.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s