Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
   v1.2.0 changes (10.12.2024):
   - ssl servers support
   - more servers can now be set
      "servers" :[
	           "irc.dal.net:6667",
		   "example.net:6669",
                   "..." (...)
                 ],
      if the server does not connect to the first server,
      it will go to the next server in the list and try to connect, etc.
   - new logs structure
   - logs now located in directories marked with date
   - separate logs for different events
      (ctcp.txt, notice.txt, server.txt, raw.txt, plugins.txt, bot.txt, #<channel>.<server>.txt)
   - new options in config:
      "ssl": true/false
      "log bot messages": true/false
      "log server messages": true/false
      "log ctcp messages": true/false
      "log notice messages": true/false
      "log channel messages": true/false
      "log plugins usage messages": true/false
      "log raw messages": true/false
      "show ctcp messages": true/false
   - bot now shows info about sending raw commands
   - "raw commands" in config changed
      from: "JOIN #test1;JOIN #test2"
      to  : "JOIN test1",
            "JOIN test2",
	    "..." etc,.
  • Loading branch information
S3x0r committed Dec 9, 2024
1 parent 3a3abee commit c923dab
Show file tree
Hide file tree
Showing 20 changed files with 606 additions and 346 deletions.
2 changes: 1 addition & 1 deletion BOT.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function ifWindowsOs()
/* checks if we have all the files */
foreach ($botCoreFiles as $botCoreFile) {
if (is_file("src/{$botCoreFile}")) {
include("src/{$botCoreFile}");
require_once("src/{$botCoreFile}");
} else {
echo "\n";
echo " I need a file '{$botCoreFile}' to work!\n\n",
Expand Down
31 changes: 31 additions & 0 deletions DOCS/CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,4 +1,35 @@

v1.2.0 changes (10.12.2024):
- ssl servers support
- more servers can now be set
"servers" :[
"irc.dal.net:6667",
"example.net:6669",
"..." (...)
],
if the server does not connect to the first server,
it will go to the next server in the list and try to connect, etc.
- new logs structure
- logs now located in directories marked with date
- separate logs for different events
(ctcp.txt, notice.txt, server.txt, raw.txt, plugins.txt, bot.txt, #<channel>.<server>.txt)
- new options in config:
"ssl": true/false
"log bot messages": true/false
"log server messages": true/false
"log ctcp messages": true/false
"log notice messages": true/false
"log channel messages": true/false
"log plugins usage messages": true/false
"log raw messages": true/false
"show ctcp messages": true/false
- bot now shows info about sending raw commands
- "raw commands" in config changed
from: "JOIN #test1;JOIN #test2"
to : "JOIN test1",
"JOIN test2",
"..." etc,.

v1.1.9 changes (01.12.2024):
- added in config "owner message on join channel", if set to true and "owner message" is provided.
This message will be shown if owner joins channel
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/ADMIN/cham.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ function plugin_cham()
}
}
} catch (Exception $e) {
cliLog('[ERROR]: Function: '.__FUNCTION__.' failed');
cliBot('[ERROR]: Function: '.__FUNCTION__.' failed');
}
}
4 changes: 2 additions & 2 deletions PLUGINS/OWNER/cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ function plugin_cluster()
if (msgPieces()[0] == 'shutdown' && msgPieces()[1] == getBotNickname()) {
response('Shutting down machine...');

cliLog('SHUTTING DOWN COMPUTER!');
cliBot('SHUTTING DOWN COMPUTER!');

exec('shutdown -s -t 0');
}
/* all */
if (msgPieces()[0] == 'shutdown' && msgPieces()[1] == '*') {
response('Shutting down machine...');

cliLog('SHUTTING DOWN COMPUTER!');
cliBot('SHUTTING DOWN COMPUTER!');

exec('shutdown -s -t 0');
}
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/OWNER/restart.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function plugin_restart()
toServer('QUIT :Restarting...');

/* send cli messages */
cliLog('Restarting BOT...');
cliBot('Restarting BOT...');

if (ifWindowsOs()) {
chdir('src/php');
Expand Down
191 changes: 102 additions & 89 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,64 @@
{
"BOT": {
"nickname" : "minion",
"name" : "http://github.com/S3x0r/MINION",
"ident" : "minion",
"bot modes": ""
},
"SERVER": {
"server" : "localhost",
"port" : 6667,
"server password" : "",
"how many times connect to server" : 99,
"connect delay" : 6,
"show message of the day" : false
},
"OWNER": {
"bot admin" : "minion <user@localhost>",
"owner password" : "47a8f9b32ec41bd93d79bf6c1c924aaecaa26d9afe88c39fc3a638f420f251ed",
"owner message on join channel": true,
"owner message": "Bello my master!"
},
"PRIVILEGES": {
"OWNER" : "",
"ADMIN" : "",
"USER" : ""
},
"USERSLEVELS": {
"OWNER" : 0,
"ADMIN" : 1,
"USER" : 999
},
"RESPONSE": {
"bot response" : "notice"
},
"AUTOMATIC": {
"auto op" : true,
"auto op list" : "",
"auto rejoin" : true,
"keep channel modes" : true,
"keep nick" : true
},
"CHANNEL": {
"channel" : "#minion",
"auto join" : true,
"channel modes" : "nt",
"channel key" : "",
"channel topic" : "bello!",
"keep topic" : true,
"give voice users on join channel": false
},
"COMMANDS": {
"raw commands on start": ""
},
"MESSAGE": {
"BOT": {
"nickname": "minion",
"name": "http://github.com/S3x0r/MINION",
"ident": "minion",
"bot modes": ""
},
"SERVER": {
"servers": [
"localhost:6667",
"irc.dal.net:6667",
"other server:7000"
],
"ssl": false,
"server password": "",
"how many times connect to server": 5,
"connect delay": 6,
"show message of the day": false
},
"OWNER": {
"bot admin": "minion <user@localhost>",
"owner password": "47a8f9b32ec41bd93d79bf6c1c924aaecaa26d9afe88c39fc3a638f420f251ed",
"owner message on join channel": true,
"owner message": "Bello my master!"
},
"PRIVILEGES": {
"OWNER": "",
"ADMIN": "",
"USER": ""
},
"USERSLEVELS": {
"OWNER": 0,
"ADMIN": 1,
"USER": 999
},
"RESPONSE": {
"bot response": "notice"
},
"AUTOMATIC": {
"auto op": true,
"auto op list": "",
"auto rejoin": true,
"keep channel modes": true,
"keep nick": true
},
"CHANNEL": {
"channel": "#minion",
"auto join": true,
"channel modes": "nt",
"channel key": "",
"channel topic": "bello!",
"keep topic": true,
"give voice users on join": false
},
"COMMANDS": {
"raw commands on start": [
"",
""
]
},
"MESSAGE": {
"show channel user messages": false,
"show channel kicks messages": true,
"show private messages": false,
Expand All @@ -62,39 +69,45 @@
"show users invite messages": true,
"show topic changes": true,
"show nick changes": true,
"show plugin usage info": true
},
"BANS": {
"ban list" : "nick!ident@hostname, *!ident@hostname, *!*@onlyhost"
},
"COMMAND": {
"command prefix" : "!"
},
"CTCP": {
"ctcp response" : true,
"ctcp version" : "minion (1.1.9) powered by minions!",
"ctcp finger" : "minion"
},
"DELAYS": {
"channel delay" : 1,
"private delay" : 1,
"notice delay" : 1
},
"LOGS": {
"logging" : true
},
"TIME": {
"timezone" : "Europe/Warsaw"
},
"FETCH": {
"fetch server" : "https://raw.githubusercontent.com/S3x0r/minion_repository_plugins/master"
},
"PROGRAM": {
"play sounds" : true
},
"DEBUG": {
"show raw" : false,
"show own messages in raw mode" : false,
"show debug" : false
}
}
"show plugin usage info": true,
"show ctcp messages": true
},
"BANS": {
"ban list": "nick!ident@hostname, *!ident@hostname, *!*@onlyhost"
},
"COMMAND": {
"command prefix": "!"
},
"CTCP": {
"ctcp response": true
},
"DELAYS": {
"channel delay": 1,
"private delay": 1,
"notice delay": 1
},
"LOGS": {
"logging": true,
"log bot messages": true,
"log server messages": true,
"log ctcp messages": true,
"log notice messages": true,
"log channel messages": true,
"log plugins usage messages": true,
"log raw messages": false
},
"TIME": {
"timezone": "Europe/Warsaw"
},
"FETCH": {
"fetch server": "https://raw.githubusercontent.com/S3x0r/minion_repository_plugins/master"
},
"PROGRAM": {
"play sounds": true
},
"DEBUG": {
"show raw": false,
"show own messages in raw mode": false,
"show debug": false
}
}
4 changes: 2 additions & 2 deletions docs/config info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ident = 'http://github.com/S3x0r/MINION'
[SERVER]

; server where to connect
server = 'minionki.com.pl'
server = 'irc.dal.net'

; server port
port = '6667'
Expand All @@ -29,7 +29,7 @@ connect_delay = '10'
[OWNER]

; you can set info about bot administrator here
bot_admin = 'S3x0r <olisek@gmail.com>'
bot_admin = 'minions <example@example.com>'

; bot will give op's if this hosts join channel
auto_op_list = 'S3x0r!S3x0r@Clk-945A43A3, nick!ident@some.other.host'
Expand Down
5 changes: 2 additions & 3 deletions src/args.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function checkCliArguments()
switch ($argument_1) {
case '-h': /* show help */
echo N.' Minion Bot cli commands usage: php BOT.php -[option]'.NN,
' -c <config_file> # loads config from the specified path (eg. C:\my folder\\'.getConfigFileName().')'.N, /* config file */
' -c <config_file> # loads config from the specified path (eg. C:\my folder\\'.getConfigFileName().')'.N,
' -h # this help'.N, /* help */
' -n # set bot nickname'.N, /* change bot nickname */
' -o <server> <port> # connect to specified server: (eg. php BOT.php -o irc.dal.net 6667)'.N, /* server */
Expand Down Expand Up @@ -60,8 +60,7 @@ function checkCliArguments()

case '-o': /* server connect: eg: irc.example.net 6667 */
if (!empty($argument_2) && !empty($argument_3) && is_numeric($argument_3)) {
saveValueToConfigFile('SERVER', 'server', $argument_2);
saveValueToConfigFile('SERVER', 'port', $argument_3);
/* we will check this later in code */
} elseif (empty($argument_2)) {
cliError('You need to specify server address, Exiting.');
exit;
Expand Down
11 changes: 7 additions & 4 deletions src/bot_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,14 @@ function bot_set_own_modes()
//---------------------------------------------------------------------------------------------------------
function bot_user_commands()
{
if (!empty(loadValueFromConfigFile('COMMANDS', 'raw commands on start'))) {
$commands = explode(';', loadValueFromConfigFile('COMMANDS', 'raw commands on start'));
if (!empty(loadValueFromConfigFile('COMMANDS', 'raw commands on start')[0])) {
$commands = loadValueFromConfigFile('COMMANDS', 'raw commands on start');

foreach ($commands as $command) {
toServer($command);
if (!empty($command)) {
cliBot('Sending raw command from config: "'.$command.'"');
toServer($command);
}
}
}
}
Expand Down
Loading

0 comments on commit c923dab

Please sign in to comment.