aboutsummaryrefslogtreecommitdiffstats
path: root/random.pl
diff options
context:
space:
mode:
authorArianit Kukaj <arianit@hax.al>2025-05-26 17:35:15 +0000
committerArianit Kukaj <arianit@hax.al>2025-05-26 17:35:15 +0000
commitf0572ea86ceda0f5df29bb7f05c279092ae7e495 (patch)
treeb273627dd2fe7c6872c5f29f5b00e7ab606d4814 /random.pl
downloadIRCbot-sshaccount-f0572ea86ceda0f5df29bb7f05c279092ae7e495.tar.gz
IRCbot-sshaccount-f0572ea86ceda0f5df29bb7f05c279092ae7e495.zip
Diffstat (limited to 'random.pl')
-rw-r--r--random.pl32
1 files changed, 32 insertions, 0 deletions
diff --git a/random.pl b/random.pl
new file mode 100644
index 0000000..92cf168
--- /dev/null
+++ b/random.pl
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+use IO::Socket;
+
+my @nicks = qw(jett Bardha Endrita Mirja Omla);
+
+while (1) {
+ my $nick = $nicks[rand @nicks];
+ my $socket = new IO::Socket::INET (
+ PeerAddr => 'irc.shoqni.net',
+ PeerPort => 6667,
+ Proto => 'tcp',
+ );
+
+ if ($socket) {
+ print $socket "NICK $nick\r\n";
+ print $socket "USER $nick 0 * :Vizitor nga Shoqni.com\r\n";
+
+
+ while (my $input = <$socket>) {
+ print $input;
+ print $socket "JOIN #chat\r\n";
+ if ($input =~ /^PING(.*)$/i) {
+ print $socket "PONG $1\r\n";
+ }
+ }
+
+ close $socket;
+ }
+
+ sleep 20 * 60;
+}