/usr/share/irssi/scripts/pelix.pl is in irssi-scripts 20131030.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 | use strict;
use vars qw($VERSION %IRSSI);
use Irssi;
$VERSION = '0.3';
%IRSSI = (
authors => 'Mankeli',
contact => 'mankeli@einari.org',
name => '#pelix Helpers',
description => 'This script allows you flood shit.',
license => 'GNU/GPL',
);
# INSTRUCTIONS:
# /pelix [cmd] [length]
#
# cmds are: wtf, biy0, sepi, jupe and veez
# (sepi cmd is experimental and should be handled with extreme care)
# VERSION HISTORY:
# 0.1 wtf
# 0.1.5 biy0
# 0.1.6 sepi
# 0.2 jupe
# 0.3 veez
# biy0 script ripped from palomies mirc-script copyright(c) 2003 veezay/palomies.com(r) all rights reserved, used with permission.
sub pelix_biyo
{
my ($pituus) = @_;
my $temppi;
my $koht;
my $tod;
my $eka;
my $wanha;
$tod = int(rand(2));
if ($tod eq 0)
{
$koht = int(rand(6));
if ($koht eq 0) { $temppi = ":"; }
if ($koht eq 1) { $temppi = "."; }
if ($koht eq 2) { $temppi = "D"; }
if ($koht eq 3) { $temppi = "d"; }
if ($koht eq 4) { $temppi = ";"; }
if ($koht eq 5) { $temppi = ","; }
}
else
{
$temppi = ":";
}
$wanha = -1;
for ($koht=0; $koht<$pituus; $koht++)
{
$eka = int(rand(10));
if (($eka == 0) && ($wanha != 0)) { $temppi.=":"; }
if (($eka == 1) && ($wanha != 1)) { $temppi.="."; }
if (($eka == 2) && ($wanha != 2)) { $temppi.="d"; }
if (($eka == 3) && ($wanha != 3)) { $temppi.=";"; }
if (($eka == 4) && ($wanha != 4)) { $temppi.=","; }
if (($eka == 5) && ($wanha != 5)) { $temppi.=":"; }
if (($eka > 5) && ($eka <= 7) && ($wanha != $eka)) { $temppi.="D"; }
if (($eka == 9) && ($eka != $wanha)) { $temppi.="_"; }
}
return ($temppi);
}
sub pelix_wtf
{
my ($pituus) = @_;
my $temppi;
my $koht;
$temppi = "";
# srand();
for ($koht=0; $koht<$pituus; $koht++)
{
if (int(rand(2)) eq 0)
{
$temppi.=";D ";
}
else
{
$temppi.="? ";
}
}
return($temppi);
}
sub pelix_jupe
{
my ($pituus) = @_;
my $temppi;
my $koht;
my $luku;
$temppi = "";
# srand();
for ($koht=0; $koht<$pituus; $koht++)
{
$luku = int(rand(7));
if ($luku < 3)
{
$temppi.=":P";
}
elsif($luku == 3)
{
$temppi.=";PP;"
}
else
{
$temppi.="?";
}
if (int(rand(4)) < 3)
{
$temppi.=" ";
}
}
return($temppi);
}
sub pelix_veez
{
my ($pituus) = @_;
my $temppi;
my $koht;
$temppi = "";
for ($koht=0; $koht<$pituus; $koht++)
{
if (int(rand(2)) eq 0)
{
$temppi.=";";
}
else
{
$temppi.=")";
}
}
return($temppi);
}
sub sepinsqd_smile
{
my ($pituus) = @_;
my $temppi;
my $koht;
my $arvo;
$temppi = "";
for ($koht=0; $koht<$pituus; $koht++)
{
$arvo = int(rand(4));
if($arvo eq 0)
{
$temppi.="A";
}
elsif($arvo eq 1)
{
$temppi.="Å";
}
else
{
$temppi.=";";
}
}
return($temppi);
}
sub pelix
{
my @teksti;
# @version = $finger =~ /:\s*(\S+)\s*$/gm;
my ($data, $server, $witem) = @_;
my @arg = split(/ +/, $data);
my $tpit;
$tpit = @arg[1];
if (@arg[0] eq "biy0")
{
@teksti = pelix_biyo($tpit);
}
elsif (@arg[0] eq "wtf")
{
@teksti = pelix_wtf($tpit);
}
elsif (@arg[0] eq "jupe")
{
@teksti = pelix_jupe($tpit);
}
elsif (@arg[0] eq "veez")
{
@teksti = pelix_veez($tpit);
}
elsif (@arg[0] eq "sepi")
{
@teksti = sepinsqd_smile($tpit);
}
elsif (@arg[0] eq "")
{
Irssi::print("no ÄgZön specified.");
return;
}
else
{
Irssi::print("No such ÄgZön as @arg[0].");
return;
}
if (!$server || !$server->{connected})
{
Irssi::print("Not connected to server");
return;
}
if ($witem && ($witem->{type} eq "CHANNEL" || $witem->{type} eq "QUERY"))
{
$witem->command("MSG ".$witem->{name}." @teksti");
}
else
{
Irssi::print("No active channel/query in window");
}
}
sub pelix_help
{
Irssi::print("Usage: runQ");
}
Irssi::command_bind('pelix', 'pelix');
Irssi::command_bind('help pelix','pelix_help');
|