Acronym Replacer Using Regex

By chicknh8r on Sep 24, 2006

To use this snippet...

  1. Copy this code
  2. In MIRC, click "alt R"
  3. Locate your "on *:input:" section
  4. Paste this within your "on *:input:" section.

Now, whenever you type any of the acronyms within the "$regex", it will be replaced with it's corresponding acronym replacement.
This is my first attempt at using "$regex".

on *:input:*: {
  if ($regex($1-,/(afk|brb|bbl|lol|omg|stfu|rofl|roflmao|ttyl)/i)) {
    say $replace($1-,afk,Away from keyboard,brb,Be Right Back,bbl,Be Back Later,lol,Laughing Out Loud,omg,OH MY GOD!,stfu,Shut The FUK Up,rofl,Rolling On Floor Laughing,roflmao,Rolling On Floor Laughing My Ass Off,ttyl,Talk To You Later)
halt
  }
}

Comments

Sign in to comment.
Jethro   -  Feb 22, 2011

That regex is absolutely pointless with the way chicknh8r has set up. chickn8r should have used $regml(1) in place of $1- for the $replace. The snippet can work fine without it though.

 Respond  
VixenSilvera   -  Feb 22, 2011

This script is good as in it doesn't echo (aka lol Laughing Out Loud> both get inputed to the chat) but if I try to change my nick to afk it makes it Away From Keyboard. Suggestion would be to find a way to make it to where it only changes the word if it is by itself and not attached to something else like a nick or in a /me action or in a /notice or /notify or other server command. Just a thought.

 Respond  
dj_boT   -  Jul 06, 2007

well kind of good but simple but cant work for: :) :( etc

 Respond  
totalybored   -  Sep 25, 2006

why it say what i type and that?
if i say lol it does:

Laughing Out Loud lol
 Respond  
chicknh8r   -  Sep 24, 2006

Updated code, ty sean.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.