Get Help

Automatically toggle Allow Links only when you share a link

Share and find mIRC Scripts that are useful on Ustream Chat.
Forum rules
Please take a moment to read the rules before sharing any scripts or replying to any posts in this forum.

Automatically toggle Allow Links only when you share a link

Postby usrbingeek » Fri Feb 01, 2013 9:04 pm

This script is useful to Ustream Broadcasters and their moderators so they can share a domain, link, or URL in their Ustream chat withoutmanually toggling the Allow/Don't Allow Links setting.

The script looks for domains, links, or URLs that begin with either http:// or www. and when one is included in your line of chat, it'll automatically toggle the setting to allow the link. It'll then toggle the setting immediately after disabling the links again.

The script checks the setting so it won't toggle allow/don't allow if links are already allowed or vice versa.

Note:
For the script to work you must be logged in to the chat as the Broadcaster or a moderator.

How to install this script:
Copy the code below and paste it into a NEW remote file. (In mIRC, hit ALT + R and a new window titled mIRC Scripts Editor should appear. Click File then New in the menu. Then Paste this code and go back to the menu and click Save as... Name the file ustreamlinks.mrc. Once saved you can close the mIRC Scripts Editor and you should be good to go!)

Code: Select all
on @*:input:#:{
  if ($network == Ustream) {
    if (/* iswm $1) { $1- | halt }
    haltdef
  if ((http:// isin $1-) || (https:// isin $1-) || (www. isin $1-) || (irc. isin $1-) || (.tv isin $1-) || (.com isin $1-) || (.org isin $1-) || (.net isin $1-) || (@ isin $1-)) {
      if (U !isincs $chan(#).mode) {
        say $1-
      }
      if (U isincs $chan(#).mode) {
        mode $chan -U
        timersayURL 1 1 say $1-
        timersayURL2 1 2 mode $chan +U
      }
    }
    else {
      say $1-
    }
  }
}

All my best,
Steve / usrbingeek
Admin

Follow me on twitter
My Amazon.com Wishlist

Opinions expressed are my own.

Since your questions may also be of benefit to others please post them to the board in place of a PM.
User avatar
usrbingeek
Admin
Admin
 
Posts: 227
Joined: Sun Jul 03, 2011 10:32 pm
Location: Burlington, VT

Sponsored Links

Postby Sponsored Links » Fri Aug 27, 2004 12:01 am


Sponsored Links
VP of Marketing
 
Posts: 10100
Joined: Fri Aug 27, 2004 12:01 am
Location: Mountain View, CA

Re: Automatically toggle Allow Links only when you share a l

Postby usrbingeek » Sun Mar 03, 2013 2:39 pm

Script updated (above) with detection for popular TLDs typed without http:// or www. and also added email address detection.
All my best,
Steve / usrbingeek
Admin

Follow me on twitter
My Amazon.com Wishlist

Opinions expressed are my own.

Since your questions may also be of benefit to others please post them to the board in place of a PM.
User avatar
usrbingeek
Admin
Admin
 
Posts: 227
Joined: Sun Jul 03, 2011 10:32 pm
Location: Burlington, VT


Return to mIRC Scripts

Who is online

Users browsing this forum: No registered users and 1 guest