Browse Source

updated wat.pl, for some reason

master
katherine 3 years ago
parent
commit
faf1127ba2
1 changed files with 39 additions and 31 deletions
  1. +39
    -31
      wat.pl

+ 39
- 31
wat.pl View File

@@ -2,29 +2,32 @@ use strict;
use warnings;
use utf8;

weechat::register ("wat", "shmibs", "0.3", "GPL", "intentionally obfuscate speach ( usage: enable/disable with /wat <on|off> )", "", "");
use String::Approx 'amatch';

weechat::register ("wat", "shmibs", "0.3", "GPL", "untentionally obfscate speach ( usage: enable/disable with /wat <on|off> )", "", "");
weechat::hook_command("wat", "", "", "", "", "toggle", "");
weechat::hook_modifier("input_text_content", "catch_word", "");
weechat::hook_modifier("input_text_for_buffer", "catch_send", "");

my @replacements = (
'pony', 'broken', 'portable', 'salivating', 'boring', 'garish', 'putrid',
'pustule', 'cardigan', 'foreign', 'dumpling', 'phalanges', 'goose',
'didactic', 'vroooOOOOM', 'zygote', 'tractor', 'blatant',
'authoritatively', 'feral', 'dung', 'scones', 'busted', 'tortoise',
'willingly', 'glorious', 'torpor', 'gracious', 'cretan', 'variantly',
'stammers', 'occupational', 'dissipated', 'Singapore', 'afterglow', 'toes',
'whorls', 'sneakiness', 'Johannesburg', 'inextricable', 'slaughterhouse',
'prophecy', 'zoo animal', 'beafy', 'telescoping', 'countess', 'marsupial',
'boots', 'guided', 'titillating', 'bequeath', 'delineation', 'ballpark',
'stultify', 'ionise', 'expand', 'cybernetics', 'alluring', 'medicinal',
'gross', 'fallopian', 'bituminous', 'soupy', 'whisper', 'blast', 'crunchy',
'categorical imperative', 'Arian', 'craving', 'triste', 'placenta',
'caramelised', 'plaster', 'God Fearing', 'hyperbole', 'tepid', 'gore',
'distance', 'Artistic Freedom', 'unix', 'drifting', 'bully', '%s.io',
'%s.js', '%s.net', 'try %s or so', '%s-less', '%s-ish', 'and but so %s',
'GNU/%s', '/%s/', 'the %s debate', '%s, our benevolent dictator,'
);
my @replacements = ('pony', 'broken', 'portable', 'salivating', 'boring',
'garish', 'putrid', 'pustule', 'cardigan', 'foreign', 'dumpling',
'phalanges', 'goose', 'didactic', 'vroooOOOOM', 'zygote', 'tractor',
'blatant', 'authoritatively', 'feral', 'dung', 'scones', 'busted',
'tortoise', 'willingly', 'glorious', 'torpor', 'gracious', 'cretan',
'variantly', 'stammers', 'occupational', 'dissipated', 'Singapore',
'afterglow', 'toes', 'whorls', 'sneakiness', 'Johannesburg',
'inextricable', 'slaughterhouse', 'prophecy', 'zoo animal', 'beafy',
'telescoping', 'countess', 'marsupial', 'boots', 'guided', 'titillating',
'bequeath', 'delineation', 'ballpark', 'stultify', 'ionise', 'expand',
'cybernetics', 'alluring', 'medicinal', 'gross', 'fallopian', 'bituminous',
'soupy', 'whisper', 'blast', 'crunchy', 'categorical imperative', 'Arian',
'craving', 'triste', 'placenta', 'caramelised', 'plaster', 'God Fearing',
'hyperbole', 'tepid', 'gore', 'distance', 'Artistic Freedom', 'unix',
'drifting', 'bully');

my @wrappers = ('%s.io', '%s.js', '%s.net', 'try %s or so', '%s-less',
'%s-ish', 'and but so %s', 'GNU/%s', '/%s/', 'the %s debate', '%s, our
benevolent dictator,');

my $state = "off";
my $length = 0;
@@ -85,7 +88,7 @@ sub mutate {
my $punctuation = 0;
my $rnum = int(rand(100));

if($words[$#words] && $rnum < 20) {
if($words[$#words] && $rnum < 25) {

# maintain the position of punctuation
if( $words[$#words] =~ /[.,'"\?!:;\[\]\(\)]/ ) {
@@ -93,31 +96,36 @@ sub mutate {
$words[$#words] = substr($words[$#words], 0, length($words[$#words])-1);
}
# grab a random replacement from the list
if($rnum < 6) {
my $i = $replacements[int(rand(@replacements))];
if(index($i, '%s') != -1) {
$words[$#words] = sprintf($i, $words[$#words]);
} else {
$words[$#words] = $i;
}
# grab a random wrapper from the list
if($rnum < 4) {
my $i = $wrappers[int(rand(@wrappers))];
$words[$#words] = sprintf($i, $words[$#words]);
}
if($rnum >= 4 && $rnum < 11) {
}

# swap two words at random
if($rnum >= 6 && $rnum < 12) {
if($rnum >= 11 && $rnum < 15) {
my $i = int(rand(@words));
my $j = int(rand(@words));
@words[$i,$j] = @words[$j,$i];
}
# induce typos
if($rnum >= 12) {
# swap chars
if($rnum >= 15 && $rnum < 20) {
my @chars = split(//, $words[$#words]);
my $i = int(rand(@chars));
my $j = int(rand(@chars));
@chars[$i,$j] = @chars[$j,$i];
$words[$#words] = join('', @chars);
}

# delete chars
if($rnum >= 20) {

}
# maintain the position of punctuation, part
# two


Loading…
Cancel
Save