[PITC] Caps Channel [v1+]

By TMFKSOFT on Apr 20, 2013

EVER FELT LIKE TALKING IN CAPS IN ONE CHANNEL ALONE!?

Well load this script up and you can kick those out who think its cool to speak in lowercase!

Keep your channel SHIFT KEY HAPPY!

Change #caps to any channel you desire and load the script.

== IMPORTANT ==
This script is intended for fun use!
Load AFTER connection else youll have to manually join the channel!

To stop the nick change comment out line 10!

=== - ~ - ===

Script by Thomas Edwards for use with PITC v1+
Get it now from http://pitc.x10.mx/ cant be bothered to Get it?
Why not GIT it! http://github.com/tmfksoft/PITC/

<?php
// CAPS Channel Script.
// Joins the configured channel and kicks anyone who doesnt use CAPS!

$caps_channel = "#CAPS"; // Most people use #caps

// Leave anything below.
$api->join("0");
$api->raw("NICK :CAPSBOT");
$api->join($caps_channel);
$api->addTextHandler("caps_text");
$api->addActionHandler("caps_text");

function caps_text($args) {
    global $api,$caps_channel;

    $msg = $args['text'];
    $chan = strtolower($args['channel']);
    if ($chan === strtolower($caps_channel)) {
        $has_lower = 0;
        $nick = trim($args['nick'],"+%@%~");

        $length = strlen($msg);
        for ($i=0;$i<$length;$i++) {
            if (!ctype_upper($msg[$i]) && ctype_alpha($msg[$i])) {
                $has_lower = 1;
                $api->pecho("CHAR #{$i}:{$msg[$i]} HAS BEEN DETECTED AS LOWER CASE!");
            }
        }

        if ($has_lower === 1) {
            $api->pecho($caps_channel.": Bad Message! Kicking {$nick}");
            $api->raw("KICK {$caps_channel} $nick :CAPS ONLY IN THIS CHANNEL!");
        }
        else {
            $api->pecho($caps_channel.": Good Message - Ignored");
        }
    }
}
?>

Comments

Sign in to comment.
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.