Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.66 KB | None | 0 0
  1. warning: php binary given in ~/phpbin doesn't exist, searching for one.
  2. php binary located.
  3. b0VIM 7.3Hñ^Md6ü0megajosh2arch-linux~megajosh2/php/contra-5.2.4/core/Core_class.phputf-8U3210#"! Utpÿ`Haaÿ-Á`úùõåÿ%X+û
  4. æ
  5. É
  6. °
  7. ¬
  8.  
  9.  
  10. r
  11. `
  12. M
  13. :
  14. !
  15.  
  16. ò
  17. à
  18. Ì
  19. ½
  20. ¬
  21.  
  22.  
  23. s
  24. [
  25. =
  26. *
  27.  
  28.  
  29.  
  30. ý
  31. û
  32. ¢
  33.  
  34.  
  35. b
  36. -
  37.  
  38. ÷ × j H s? 4¹
  39. ÐÌpX
  40. 缺V5·_+Öd%ÁÀ if(DEBUG) $this->Console->Notice('Loaded startup scripts, loading internal user access levels.'); inc_files('./plugins/startup', 'php', array('core'=>$this)); // Include our startup scripts. if(DEBUG) $this->Console->Notice('Loaded dAmnPHP, loading startup scripts.'); $this->dAmn->Agent.= ' Contra/'.$this->info['version'].'/'.$this->info['release']; $this->dAmn->Agent.= 'dAmnPHP/'.$this->dAmn->Ver; $this->dAmn->Agent.= php_uname('s').' '.php_uname('r').'; en-GB; '.$this->owner.') '; $this->dAmn->Agent = 'PHP/'.PHP_VERSION.' ('.(substr(PHP_OS,-2)=='NT'?'Windows': PHP_OS).'; U; '; // And an Agent string. $this->dAmn->Client = $client; // Give the interface a client string. $this->dAmn = new dAmnPHP; // Load our dAmn interface. if(DEBUG) $this->Console->Notice('Loading dAmnPHP, client string is "'.$client.'"'); $client = $this->info['name'].' '.$this->info['version'].$this->info['status'].'/'.$this->info['release']; if(DEBUG) $this->Console->Notice('Events system loaded.'); $this->Events = new Event_System($this); // Now we load our events system. if(DEBUG) $this->Console->Notice('Config loaded, loading events system.'); $this->load_config(); // Loading config file... if(DEBUG) $this->Console->Notice('Loading bot config file.'); } $this->Console->Notice('Session ID: '.$this->session); $this->Console->Notice('Running in debug mode!');// This is for when we're running in debug mode. if(DEBUG) { $this->Console->Notice('Loading '.$this->info['name'].' '.$this->info['version'].' '.$this->info['status'].' by '.$this->info['author']); $this->Console->Notice('Hey thar!'); // Some introduction messages! We've already done quite a bit but only introduce things here... $this->Timer = new Timer($this);// Get a new timer class. if(DEBUG) $this->Console->session = $this->session; // Tell the console the session code for logging purposes. $this->Console = new Console(); // Get a new console interface. $this->sysString = php_uname('s').' '.php_uname('r').' '.php_uname('v'); // System information string. $this->start = time(); // Our start time is here. if(DEBUG) $this->session = sha1($UTS+microtime()); // Generate a session ID code. $Bot = $this; global $Bot; // Store the core class as a global variable during startup so modules can hook to it. function __construct() { ); 'Bye bye!' 'Bot has quit.', public $shutdownStr = array( public $mod = array(); public $user; public $running = false; public $Timer; public $Events; public $dAmn; public $sysString; public $Console; public $usingStored = false; public $cookie; public $session; public $autojoin; public $aboutStr; public $trigger; public $owner; protected $_password; public $username; ); 'bdsversion' => '0.2', 'author' => 'photofroggy', 'release' => 'public', 'status' => '', 'version' => '5.2.4', 'name' => 'Contra', public $info = array( public $start;class Bot { */ * you're doing, however, then go ahead. * should never be required. If you know what * Editing this file is not recommended, and * the required objects and the configurations. * whole bot to launch itself from. It loads * This class acts as a platform for the * * and build upon this work but not use it for commercial purposes, providing that you attribute me, photofroggy (froggywillneverdie@msn.com) for its creation. * Released under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License, which allows you to copy, distribute, transmit, alter, transform, * * Made for Contra by photofroggy *Bot class v3 /*<?phpad¥ÙH¼*
  41. Ç îkÿ
  42.  
  43.  
  44.  
  45.  
  46. z
  47. O
  48.  
  49. ì
  50. Á
  51.  
  52. l
  53. C
  54. ñ
  55. î
  56. ì
  57. Ò
  58. ¿
  59. «
  60.  
  61. d
  62. C
  63. &
  64.  
  65.  
  66. ËÈÆ´nL:6âßÝÜÙØ??>^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c?>?>??>} } $this->Console->Notice($string); foreach($this->shutdownStr as $id => $string) } usleep(10000); $this->Timer->triggerEvents(); $this->Events->trigger('loop'); while($this->running === true) { function run() { } $this->Events->trigger('cookie', $this->session); } $this->session = array('status' => 1, 'cookie' => $this->cookie); $this->usingStored = true; $this->Console->Notice('Using stored cookie first...'); } else { $this->session = $this->dAmn->getCookie($this->username, $this->_password); $this->Console->Notice('Retrieving cookie. This may take a while...'); if(!is_array($this->cookie)) { $this->Console->Notice(($sec === false ? 'Starting' : 'Restarting').' dAmn.'); if(empty($this->username) || empty($this->_password)) $this->load_config(); function network($sec = false) { } save_config('./storage/config.cf', $config); ); 'cookie' => empty($this->cookie) ? '' : serialize($this->cookie), 'autojoin' => $this->autojoin, 'about' => $this->aboutStr, ), 'owner' => $this->owner, 'trigger' => $this->trigger, 'password' => $this->_password, 'username' => $this->username, 'info' => array( $config = array( function save_config() { } $this->cookie = empty($config['cookie']) ? '' : unserialize($config['cookie']); $this->autojoin = $config['autojoin']; $this->aboutStr = $config['about']; $this->trigger = $config['info']['trigger']; $this->owner = $config['info']['owner']; $this->_password = $config['info']['password']; $this->username = $config['info']['username']; $config = include './storage/config.cf'; function load_config() {}} $this->Console->Warning('Exiting...'); $this->Console->Warning('Failed to start properly.'); // Looks like we failed lads. else { if($this->running===true) { $this->run(); } $this->network(); $this->Events->trigger('startup'); $this->Console->Notice('Ready!'); // So, now we're ready to get some work done! unset($GLOBALS['Bot']); // Because all modules have been loaded, we don't need the core class stored in globals, so we delete it. if(DEBUG) $this->Console->Notice('Loaded '.count($this->mod).' modules with '.count($this->Events->events['cmd']).' commands.'); $this->Events->load_mods(); // Now we load our modules. if(DEBUG) $this->Console->Notice('Loaded internal user access levels, loading modules.'); $this->user = new User_System($this->owner, $this); // Load our user level system! It's a bit late to load it here...b0VIM 7.3éFpMd6ü0megajosh2arch-linux~megajosh2/php/contra-5.2.4/core/Events_class.phputf-83210#"! Utpÿg>hûd>îgúùõÜÏ·³yuU7û
  67. ²
  68. 
  69. [
  70.  
  71. Ø
  72.  
  73. ~
  74. |
  75. [
  76. L
  77. =
  78. .
  79.  
  80.  
  81.  
  82. ò
  83. ã
  84. Ô
  85. Ã
  86. W
  87. " ÃcTQOé¼[-̽yà½VàÈ]RNƦ*%" îç N # E « public function is_hooked($mod, $meth, $event) { } ); 'User "'.$from.'" was denied access to "'.$command.'" in '.$this->core->dAmn->deform_chat($ns,$this->core->username).'.' $this->core->Console->Notice( return $this->core->mod[$cmda['m']]->$cmda['e']($ns, $from, rtrim($message), $tns); if($this->core->user->hasCmd($from, $command)) } return; $this->core->dAmn->say($tns, $from.': '.$cmda['h']); if(args($message,1)=='?'&& !empty($cmda['h'])) { } else {$tns = $ns; } $message = args($message,0).' '.args($message,2,true); $tns = $this->core->dAmn->format_chat(args($message,1));if(substr(args($message,1),0,1)=='#') { if($this->core->mod[$cmda['m']]->status === false) return; if($cmda['s'] === false) return; $cmda = $this->events['cmd'][strtolower($command)]; return $this->core->Console->Notice('Received unknown command "'.$command.'" from '.$from.'.'); if(!array_key_exists(strtolower($command), $this->events['cmd'])) */ * off. * they or the module they belong to are switched * make sure we don't launch commands when * Also pay close attention to switches, to * what channel to use as the target namespace! *to give the help for it. We also find out * Commands are triggered if we don't need * This is where the magic happens! /* public function command($command, $ns, $from, $message) { } return true; $this->core->mod[$data['m']]->$data['f']($p0, $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9); if($data['m'] == $mod && $this->core->mod[$data['m']]->status == true) foreach($this->events['evt'][$event] as $id => $data) if(!array_key_exists($event, $this->events['evt'])) return false;$p9 = false) { $p8 = false, $p7 = false, $p6 = false, $p5 = false, $p4 = false, $p3 = false, $p2 = false, $p1 = false, $p0 = false, public function trigger_mod($mod, $event, } $this->core->mod[$data['m']]->$data['f']($p0, $p1, $p2, $p3, $p4, $p5, $p6, $p7, $p8, $p9); if($this->core->mod[$data['m']]->status == true) foreach($this->events['evt'][$event] as $id => $data) if(array_key_exists($event, $this->events['evt'])) // There currently aren't any events which have this many args, but 10 spaces are available just in case. $p9 = false) { $p8 = false, $p7 = false, $p6 = false, $p5 = false, $p4 = false, $p3 = false, $p2 = false, $p1 = false, $p0 = false, public function trigger($event, } if(!array_key_exists($i['m'], $this->core->mod)) unset($this->events['cmd'][$cmd]); foreach($this->events['cmd'] as $cmd => $i) if(!array_key_exists($mod, $this->core->mod)) unset($this->events['evt'][$mod]); foreach($mods as $mod => $meths) foreach($this->events['evt'] as $event => $mods) inc_files('./plugins/extensions', '.php', array('core'=>$this->core)); public function load_mods() { public function __construct($core) { $this->core = $core; } public function __get($var) { return $this->$var; } ); 'cmd' => array() 'evt' => array(), public $events = array( public $core;class Event_System { */ * really not recommended... * for Contra! Editing this is * module events and commands * This pretty much handles all * * and build upon this work but not use it for commercial purposes, providing that you attribute me, photofroggy (froggywillneverdie@msn.com) for its creation. * Released under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License, which allows you to copy, distribute, transmit, alter, transform, * * Mþde by photofroggy! * Version 3 * Contra Events system. /*<?phpadõ>¢^&éÙÖÔ§IÜ
  88. Û
  89. £
  90. T
  91. E
  92. B
  93. @
  94. ú
  95. ¢
  96. p
  97. `
  98. R
  99. D
  100. 3
  101. #
  102.  
  103.  
  104.  
  105.  
  106.  
  107. Ö
  108.  
  109. T
  110.  
  111.  
  112.  
  113. î ¦ l : 7 5 Ìe
  114. ?>} } return true; $this->events['cmd'][strtolower($cmd)]['s'] = ($s===true ? true : false); if($this->core->mod[$this->events['cmd'][strtolower($cmd)]['m']]->type !== EXT_CUSTOM) return false; if($this->events['cmd'][strtolower($cmd)]['s'] === $s) return true; if($this->core->mod[$this->events['cmd'][strtolower($cmd)]['m']]->status === false) return false; if(!array_key_exists(strtolower($cmd), $this->events['cmd'])) return 'no such command'; if(is_string($s)) $s = ($s === 'on' ? true : false); public function switchCmd($cmd, $s = true) { } unset($this->events['cmd'][strtolower($cmd)]); if($this->events['cmd'][strtolower($cmd)]['m'] == $mod) if(!array_key_exists(strtolower($cmd), $this->events['cmd'])) return; public function delCmd($mod, $cmd) { } $this->events['cmd'][strtolower($cmd)]['h'] = $helpStr; if($this->events['cmd'][strtolower($cmd)]['m'] == $mod) if(!array_key_exists(strtolower($cmd), $this->events['cmd'])) return; public function cmdHelp($mod, $cmd, $helpStr) { } return 'added'; ); 'h' => Null, 'e' => $meth, 'p' => $p, 's' => $s, 'm' => $mod, $this->events['cmd'][strtolower($cmd)] = array( if(array_key_exists(strtolower($cmd), $this->events['cmd'])) return 'command in use'; public function add_command($mod, $cmd, $meth, $p = 25, $s = true) { } return true; if(empty($this->events['evt'][$event])) unset($this->events['evt'][$event]); array_splice($this->events['evt'][$event], $hook, 1); if($hook === false) return true; $hook = $this->is_hooked($mod, $meth, $event); if(!array_key_exists($event, $this->events['evt'])) return false; public function unhook($mod, $meth, $event) { } return true; ); 'f' => $meth, 'm' => $mod, $this->events['evt'][$event][] = array( if($this->is_hooked($mod, $meth, $event) !== false) return true; if(!array_key_exists($event, $this->events['evt'])) $this->events['evt'][$event] = array(); public function hook($mod, $meth, $event) { } return false; if($info['m'] == $mod && $info['f'] == $meth) return $id; foreach($this->events['evt'][$event] as $id => $info) if(!array_key_exists($event, $this->events['evt'])) return false; // This returns the event hook number on success, False on failure. Use === when comparing.^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c^[[?1;2c[20:57:31] ** Hey thar!
  115. [20:57:31] ** Loading Contra 5.2.4 by photofroggy
  116. [20:57:31] ** Ready!
  117. [20:57:31] ** Starting dAmn.
  118. [20:57:31] ** Retrieving cookie. This may take a while...
  119. [20:57:32] ** Got a valid cookie!
  120. [20:57:33] ** Connected to dAmnServer 0.3.
  121. [20:57:33] ** Logged in as determinacy!
  122. [20:57:33] ** Join ok for #Botdom
  123. [20:57:33] ** Got topic for #Botdom.
  124. [20:57:33] ** Got title for #Botdom.
  125. [20:57:33] ** Got privclasses for #Botdom.
  126. [20:57:33] ** Got members for #Botdom.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement