Skip to content

Commit

Permalink
1.2.5
Browse files Browse the repository at this point in the history
   v1.2.5 changes (03.01.2025):
   - code cleanup
  • Loading branch information
S3x0r committed Jan 3, 2025
1 parent d529ba5 commit e68eb34
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 200 deletions.
5 changes: 4 additions & 1 deletion DOCS/CHANGELOG.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

v1.2.5 changes (03.01.2025):
- code cleanup
// ------------------------------------------------------------------------------------------------------------------------------------------
v1.2.4 changes (31.12.2024):
- added option in config PROGRAM -> "list plugins on start": true/false
- added option in config PROGRAM -> "list plugins on start": true/false
// ------------------------------------------------------------------------------------------------------------------------------------------
v1.2.3 changes (29.12.2024):
- auto remove mirc colors from channel messages
Expand Down
4 changes: 2 additions & 2 deletions PLUGINS/OWNER/cluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ function plugin_cluster()
}

/* me */
if (msgPieces()[0] == 'shutdown' && msgPieces()[1] == getBotNickname()) {
if (msgPiece()[0] == 'shutdown' && msgPiece()[1] == getBotNickname()) {
response('Shutting down machine...');

cliBot('SHUTTING DOWN COMPUTER!');

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

cliBot('SHUTTING DOWN COMPUTER!');
Expand Down
20 changes: 10 additions & 10 deletions PLUGINS/OWNER/fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,31 +44,31 @@ function plugin_fetch()
}
}
if (msgPieces()[0] == 'get') {
if (!empty(msgPieces()[1])) {
if (!empty(msgPieces()[2])) {
if (msgPiece()[0] == 'get') {
if (!empty(msgPiece()[1])) {
if (!empty(msgPiece()[2])) {
$dirs = array_diff(scandir(PLUGINSDIR), array('..', '.'));
if (in_array(msgPieces()[2], ['USER', 'ADMIN', 'OWNER'])) {
$check_file = PLUGINSDIR."/".msgPieces()[2]."/".msgPieces()[1].".php";
if (in_array(msgPiece()[2], ['USER', 'ADMIN', 'OWNER'])) {
$check_file = PLUGINSDIR."/".msgPiece()[2]."/".msgPiece()[1].".php";
$dir_user = array_diff(scandir(PLUGINSDIR.'/USER/'), array('..', '.'));
$dir_admin = array_diff(scandir(PLUGINSDIR.'/ADMIN/'), array('..', '.'));
$dir_owner = array_diff(scandir(PLUGINSDIR.'/OWNER/'), array('..', '.'));
$all_dirs = array_merge($dir_user, $dir_admin, $dir_owner);
if (in_array(msgPieces()[1].'.php', $all_dirs)) {
if (in_array(msgPiece()[1].'.php', $all_dirs)) {
response('I already have this plugin, aborting.');
} else {
$address = loadValueFromConfigFile('FETCH', 'fetch server')."/".msgPieces()[1].".php";
$address = loadValueFromConfigFile('FETCH', 'fetch server')."/".msgPiece()[1].".php";
if (@file_get_contents($address)) {
response("Downloading plugin: '".msgPieces()[1]."' from repository to: '".msgPieces()[2]."'");
response("Downloading plugin: '".msgPiece()[1]."' from repository to: '".msgPiece()[2]."'");
$file = file_get_contents($address);
$a = fopen(PLUGINSDIR."/".msgPieces()[2]."/".msgPieces()[2].".php", 'w');
$a = fopen(PLUGINSDIR."/".msgPiece()[2]."/".msgPiece()[2].".php", 'w');
fwrite($a, $file);
fclose($a);
LoadPlugin(msgPieces()[1]);
LoadPlugin(msgPiece()[1]);
response('Plugin added.');
} else {
Expand Down
4 changes: 2 additions & 2 deletions PLUGINS/USER/hash.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function plugin_hash()
} elseif (commandFromUser() == 'help') {
response('Usage: '.commandPrefix().'hash <algorithm> <string>');
response('Algos: '.implode(' ', hash_algos()));
} elseif (in_array(msgPieces()[0], hash_algos())) {
response(msgPieces()[0].': '.hash(msgPieces()[0], inputFromLine(5)));
} elseif (in_array(msgPiece()[0], hash_algos())) {
response(msgPiece()[0].': '.hash(msgPiece()[0], inputFromLine(5)));
} else {
response('Unknown hashing algorithm.');
}
Expand Down
6 changes: 3 additions & 3 deletions PLUGINS/USER/note.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ function plugin_note()
}
break;
}
switch (msgPieces()[0]) {
switch (msgPiece()[0]) {
case 'add':
if (!empty(msgPieces()[1])) {
if (!empty(msgPiece()[1])) {
/* if file is empty */
if (is_file($notesFilename) && filesize($notesFilename) == 0) {
$note = inputFromLine('5');
Expand All @@ -90,7 +90,7 @@ function plugin_note()
if (is_file($notesFilename)) {
$writeNotes = '';
$notes = file($notesFilename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$i = msgPieces()[1];
$i = msgPiece()[1];

if (is_numeric((int)$i) && $i > 0) {
$j = $i-1;
Expand Down
2 changes: 1 addition & 1 deletion PLUGINS/USER/wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function plugin_wiki()
{
if (OnEmptyArg('wikipedia <lang> <string>')) {
} elseif (extension_loaded('openssl')) {
$json = @file_get_contents("http://".msgPieces()[0].".wikipedia.org/w/api.php?action=opensearch&list=search&search=".urlencode(inputFromLine('5')));
$json = @file_get_contents("http://".msgPiece()[0].".wikipedia.org/w/api.php?action=opensearch&list=search&search=".urlencode(inputFromLine('5')));

if (!empty($json)) {
$json = json_decode($json);
Expand Down
Loading

0 comments on commit e68eb34

Please sign in to comment.