-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBOT.php
71 lines (64 loc) · 2.49 KB
/
BOT.php
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
/* Copyright (c) 2013-2024, minions
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
//---------------------------------------------------------------------------------------------------------
!in_array(PHP_SAPI, array('cli', 'cli-server', 'phpdbg')) ?
exit('This script can\'t be run from a web browser. Use CLI terminal to run it<br>'.
'Visit <a href="https://github.com/S3x0r/MINION/">this page</a> for more information.') : false;
//---------------------------------------------------------------------------------------------------------
/* checks if the bot was started from bundled php */
dirname($_SERVER['PHP_SELF']) == '../..' ? chdir('../../') : false;
/* simple os check */
function ifWindowsOs()
{
return (PHP_OS == 'WINNT');
}
/* hide cli prompt */
echo "\e[?25l";
/* needed files */
$botFiles = ['define.php',
'args.php',
'cli.php',
'misc.php',
'config.php',
'start.php',
'actions.php',
'core_cmnds.php',
'core_cmnds_helpers.php',
'bot_events.php',
'user_events.php',
'logs.php',
'plugins.php',
'socket.php',
'numeric_events.php',
'word_events.php',
'timers.php',
'ctcp.php'
];
/* checks if we have all the files */
foreach ($botFiles as $file) {
if (is_file("src/{$file}")) {
require_once("src/{$file}");
} else {
echo "\n";
echo " I need a file '{$file}' to work!\n\n",
" You can download missing files from:\n",
" https://github.com/S3x0r/MINION/releases\n\n",
" Terminating BOT after 10 seconds.\n\n";
(ifWindowsOs()) ? sleep(10) : false;
exit;
}
}
init();