-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
franklin_helper.pl
executable file
·52 lines (48 loc) · 1.59 KB
/
franklin_helper.pl
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
#!/usr/bin/perl
# Author: by oxagast
#
# Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
# , .
# ,- | | o
# | ;-. ,-: ;-. | , | . ;-.
# |- | | | | | |< | | | |
# | ' `-` ' ' ' ` ' ' ' '
# -'
use Irssi;
use Data::Dumper;
use vars qw($VERSION %IRSSI);
#use IO::Async::Timer::Periodic;
#use IO::Async::Loop;
use Proc::Simple;
$VERSION = "2.1";
%IRSSI = (
authors => 'oxagast',
contact => '[email protected]',
name => 'franklin_helper',
description => 'Franklin LLM AI bot',
license => 'BSD',
url => 'http://franklin.oxasploits.com',
changed => 'Mar, 11th 2024',
);
Irssi::signal_add_last('message public', 'chncll');
Irssi::settings_add_str("franklin_helper", "franklin_admin", "");
our $owner = Irssi::settings_get_str("franklin_admin");
sub chncll {
my ($server, $msg, $nick, $address, $channel) = @_;
my $ln = $server->{nick};
# these commands can be used by anybody
if ($msg =~ m/^$ln[:|,] reload/i) {
$server->command("script unload franklin.pl");
$server->command("script load franklin.pl");
}
if ($nick eq $owner) { # these may only be used by botmaster
if ($msg =~ m/^$ln[:|,] levelup/i) {
$server->command("op $channel $nick");
}
if ($msg =~ m/^$ln[:|,] reboot/i) {
Irssi::print "REBOOT";
system("sh -c 'sleep 5 && sudo /sbin/reboot' &");
$server->command("quit Franklins server is going down for reboot!");
}
}
}