Skip to content

Commit

Permalink
1.1.6
Browse files Browse the repository at this point in the history
   - fixed reconnect delay time
   - new option in config: 'show_own_messages_in_raw_mode'
   - new option in config: 'show_motd' - shows server message of the day
   - logo.php removed
   - 'DOCS' and 'PLUGINS' folders are now lowercase
   - added 'start.php', 'args.php' files
   - now in -c arg you need to provide full path to file
   - silent mode removed
   - logo removed
   - new logs filename format: 'date+time-computer name'
   - bot now shows notices from server
   - separators in config file changed from '_' to '.'
   - Fixed: plugin 'say' - we can now say whole message
   - other small changes / code cleanup
  • Loading branch information
S3x0r committed Dec 28, 2022
1 parent d987fc8 commit 18b770f
Show file tree
Hide file tree
Showing 75 changed files with 1,157 additions and 1,219 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
LOGS
DATA
60 changes: 20 additions & 40 deletions BOT.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
'Visit <a href="https://github.com/S3x0r/MINION/">this page</a> for more information.') : false;
//---------------------------------------------------------------------------------------------------------

/* PHP_EOL shortcuts */
define('N', PHP_EOL);
define('NN', PHP_EOL.N);

/* check if the bot was launched from the attached php */
dirname($_SERVER['PHP_SELF']) == '../..' ? chdir('../../') : false;

Expand All @@ -35,59 +31,43 @@
echo "\e[?25l";

/* needed files */
$botCoreFiles = ['cli.php',
$botCoreFiles = ['define.php',
'args.php',
'cli.php',
'misc.php',
'config.php',
'core_commands.php',
'debug.php',
'define.php',
'events.php',
'logo.php',
'logs.php',
'plugins.php',
'socket.php',
'timers.php',
'web.php',
'ctcp.php'
'ctcp.php',
'start.php'
];

/* check if we got all files */
foreach ($botCoreFiles as $botCoreFile) {
if (is_file("src/{$botCoreFile}")) {
require_once("src/{$botCoreFile}");
} else {
echo N;
echo " I need a file '{$botCoreFile}' to work!".NN,
' You can download missing files from:'.N,
' https://github.com/S3x0r/MINION/releases'.NN,
' Terminating program after 10 seconds.'.NN;
!isset($GLOBALS['os']) ? sleep(10) : false;
exit;
echo "\n";
echo " I need a file '{$botCoreFile}' to work!\n\n",
" You can download missing files from:\n",
" https://github.com/S3x0r/MINION/releases\n\n",
" Terminating program after 10 seconds.\n\n";
!isset($GLOBALS['os']) ? sleep(10) : false;
exit;
}
}

/* if we cannnot write */
if (!is_writable('BOT.php')) {
echo "\n Bot has no permissions to save files, Check your permissions! Exiting.";
WinSleep(7);
exit;
} else {
!is_dir(LOGSDIR) ? mkdir(LOGSDIR) : false;
!is_dir(DATADIR) ? mkdir(DATADIR) : false;
}
//---------------------------------------------------------------------------------------------------------

/* Check if we got cli args */
CheckCliArgs();

/* Load config */
LoadConfig();

/* Logging init */
LogsInit();

/* Load plugins */
LoadPlugins();

/* Time to connect */
Connect();
/* if we cannot write */
if (!is_writable('BOT.php')) {
echo "\n Bot has no permissions to save files, Check your permissions! Exiting.";
WinSleep(7);
exit;
} else {
Start();
}
77 changes: 36 additions & 41 deletions CONFIG.INI
Original file line number Diff line number Diff line change
Expand Up @@ -20,97 +20,100 @@ server = 'irc.dal.net'
port = '6667'

; if irc server have password
server_password = ''
server.password = ''

; try connect 'n' (in seconds) times to server, if cannot then quit
try_connect = '99'
try.connect = '99'

; delay (in seconds) after new connection to server
connect_delay = '6'
connect.delay = '6'

; show message of the day
show.motd = 'yes'

[OWNER]

; bot administrator information
bot_admin = 'S3x0r <user@localhost>'
bot.admin = 'S3x0r <user@localhost>'

; bot will give op's if this hosts join channel <nick!ident@hostname>
auto_op_list = ''
auto.op.list = ''

; BOT OWNER HOSTS <nick!ident@hostname>
bot_owners = ''
bot.owners = ''

; owner password (SHA256)
owner_password = '47a8f9b32ec41bd93d79bf6c1c924aaecaa26d9afe88c39fc3a638f420f251ed'
owner.password = '47a8f9b32ec41bd93d79bf6c1c924aaecaa26d9afe88c39fc3a638f420f251ed'

[ADMIN]

; bot admin list <nick!ident@hostname>
admin_list = ''
admin.list = ''

[RESPONSE]

; where bot should response, you can choose from: channel, notice, priv
bot_response = 'notice'
bot.response = 'notice'

[AUTOMATIC]

; bot will give op when join to channel from auto_op_list: 'yes', 'no'
auto_op = 'yes'
; bot will give op when join to channel from auto.op.list: 'yes', 'no'
auto.op = 'yes'

; bot will auto rejoin channel when kicked: 'yes', 'no'
auto_rejoin = 'yes'
auto.rejoin = 'yes'

; do we want to keep channel modes from channel_modes option?
keep_chan_modes = 'yes'
; do we want to keep channel modes from channel.modes option?
keep.chan.modes = 'yes'

; this setting makes the bot try to get his original nickname back if its primary nickname is already in use
keep_nick = 'yes'
keep.nick = 'yes'

[CHANNEL]

; channel where to join when connected
channel = '#minion'

; auto join channel when connected: 'yes', 'no'
auto_join = 'yes'
auto.join = 'yes'

; set channel modes on bot join
channel_modes = 'nt'
channel.modes = 'nt'

; channel key if exists
channel_key = ''
channel.key = ''

[BANS]

; ban users from this list
ban_list = 'nick!ident@hostname, *!ident@hostname, *!*@onlyhost'
ban.list = 'nick!ident@hostname, *!ident@hostname, *!*@onlyhost'

[COMMAND]

; bot commands prefix eg. !info, you can change to what you want
command_prefix = '!'
command.prefix = '!'

[CTCP]

; response to ctcp requests? 'yes', 'no'
ctcp_response = 'yes'
ctcp.response = 'yes'

; ctcp version response (please do not change it:)
ctcp_version = 'MINION (1.1.5) powered by minions!'
ctcp.version = 'MINION (1.1.6) powered by minions!'

; ctcf finger response
ctcp_finger = 'MINION'
ctcp.finger = 'MINION'

[DELAYS]

; bot response delay on channel (in seconds)
channel_delay = '1.5'
channel.delay = '1.5'

; bot response delay on private messages (in seconds)
private_delay = '1'
private.delay = '1'

; bot response delay on notice messages (in seconds)
notice_delay = '1'
notice.delay = '1'

[LOGS]

Expand All @@ -120,36 +123,28 @@ logging = 'yes'
[PANEL]

; web panel login
web_login = 'changeme'
web.login = 'changeme'

; web panel password
web_password = 'changeme'
web.password = 'changeme'

[TIME]

; bot time zone
time_zone = 'Europe/Warsaw'
time.zone = 'Europe/Warsaw'

[FETCH]

; bot plugin repository address
fetch_server = 'https://raw.githubusercontent.com/S3x0r/minion_repository_plugins/master'
fetch.server = 'https://raw.githubusercontent.com/S3x0r/minion_repository_plugins/master'

[PROGRAM]

; show BOT startup logo: 'yes', 'no'
show_logo = 'yes'

; no output to CLI window: 'yes', 'no'
silent_mode = 'no'

; check on program startup if new version is on server: 'yes', 'no'
check_update = 'no'

; if we want to play sounds?: 'yes', 'no'
play_sounds = 'yes'
play.sounds = 'yes'

[DEBUG]

; show raw output on CLI window
show_raw = 'no'
show.raw = 'no'
show.own.messages.in.raw.mode = 'no'
16 changes: 16 additions & 0 deletions DOCS/CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@

v1.1.6 changes (28.12.2022):
- fixed reconnect delay time
- new option in config: 'show_own_messages_in_raw_mode'
- new option in config: 'show_motd' - shows server message of the day
- logo.php removed
- 'DOCS' and 'PLUGINS' folders are now lowercase
- added 'start.php', 'args.php' files
- now in -c arg you need to provide full path to file
- silent mode removed
- logo removed
- new logs filename format: 'date+time-computer name'
- bot now shows notices from server
- separators in config file changed from '_' to '.'
- Fixed: plugin 'say' - we can now say whole message
- other small changes / code cleanup

v1.1.5 changes (28.12.2020):
- code cleanup

Expand Down
1 change: 0 additions & 1 deletion DOCS/CLI Arguments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
-h # this help
-o <server> <port> # connect to specified server: eg: BOT.php irc.dal.net 6667
-p <password> # hash password to SHA256
-s # silent mode (no output from bot)
-u # check if there is new bot version on server
-v # prints bot version
9 changes: 0 additions & 9 deletions DOCS/config.ini info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,6 @@ fetch_server = 'https://raw.githubusercontent.com/S3x0r/minion_repository_pl

[PROGRAM]

; show BOT startup logo? 'yes', 'no'
show_logo = 'yes'

; silent mode - no output to CLI window 'yes', 'no'
silent_mode = 'no'

; check on program startup if new version is on server 'yes', 'no'
check_update = 'no'

; if we want to play sounds?: 'yes', 'no'
play_sounds = 'yes'

Expand Down
12 changes: 6 additions & 6 deletions PLUGINS/ADMIN/autoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Adds host to autoop list in config file: {$GLOBALS['CONFIG_CMD_PREFIX']}autoop <nick!ident@host>";
$plugin_description = "Adds host to autoop list in config file: {$GLOBALS['CONFIG.CMD.PREFIX']}autoop <nick!ident@host>";
$plugin_command = 'autoop';

function plugin_autoop()
Expand All @@ -31,18 +31,18 @@ function plugin_autoop()
if (OnEmptyArg('autoop <nick!ident@hostname>')) {
} elseif ($nick[0] != getBotNickname()) {
if (preg_match('/^(.+?)!(.+?)@(.+?)$/', $GLOBALS['args'], $host)) {
LoadData($GLOBALS['configFile'], 'OWNER', 'auto_op_list');
LoadData($GLOBALS['configFile'], 'OWNER', 'auto.op.list');

if (strpos($GLOBALS['LOADED'], $GLOBALS['args']) !== false) {
response('I already have this host.');
} else {
empty($GLOBALS['LOADED']) ? $new_list = $host[0] : $new_list = "{$GLOBALS['LOADED']}, {$host[0]}";
empty($GLOBALS['LOADED']) ? $new_list = $host[0] : $new_list = "{$GLOBALS['LOADED']}, {$host[0]}";

SaveData($GLOBALS['configFile'], 'OWNER', 'auto_op_list', $new_list);
SaveData($GLOBALS['configFile'], 'OWNER', 'auto.op.list', $new_list);

/* update variable with new owners */
$cfg = new IniParser($GLOBALS['configFile']);
$GLOBALS['CONFIG_AUTO_OP_LIST'] = $cfg->get("OWNER", "auto_op_list");
$GLOBALS['CONFIG.AUTO.OP.LIST'] = $cfg->get("OWNER", "auto.op.list");

/* Inform nick about it */
privateMsg('From now you are on my auto op list, enjoy.');
Expand All @@ -53,6 +53,6 @@ function plugin_autoop()
response('Bad input, try: nick!ident@hostname');
}
} else {
response('I cannot add myself to auto op list, im already OP MASTER :)');
response('I cannot add myself to auto op list, iam already OP MASTER!');
}
}
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Ban specified host: {$GLOBALS['CONFIG_CMD_PREFIX']}ban <nick!ident@host>";
$plugin_description = "Ban specified host: {$GLOBALS['CONFIG.CMD.PREFIX']}ban <nick!ident@host>";
$plugin_command = 'ban';

function plugin_ban()
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/cham.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Shows random text from file: {$GLOBALS['CONFIG_CMD_PREFIX']}cham <nick>";
$plugin_description = "Shows random text from file: {$GLOBALS['CONFIG.CMD.PREFIX']}cham <nick>";
$plugin_command = 'cham';

/*
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/deop.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Deops someone: {$GLOBALS['CONFIG_CMD_PREFIX']}deop <nick>";
$plugin_description = "Deops someone: {$GLOBALS['CONFIG.CMD.PREFIX']}deop <nick>";
$plugin_command = 'deop';

function plugin_deop()
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/devoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Devoice user: {$GLOBALS['CONFIG_CMD_PREFIX']}devoice <nick>";
$plugin_description = "Devoice user: {$GLOBALS['CONFIG.CMD.PREFIX']}devoice <nick>";
$plugin_command = 'devoice';

function plugin_devoice()
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/gethost.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//---------------------------------------------------------------------------------------------------------

$VERIFY = 'bfebd8778dbc9c58975c4f09eae6aea6ad2b621ed6a6ed8a3cbc1096c6041f0c';
$plugin_description = "Ip address to hostname change: {$GLOBALS['CONFIG_CMD_PREFIX']}gethost <ip>";
$plugin_description = "Ip address to hostname change: {$GLOBALS['CONFIG.CMD.PREFIX']}gethost <ip>";
$plugin_command = 'gethost';

/*
Expand Down
Loading

0 comments on commit 18b770f

Please sign in to comment.