<?php $lang = array('en' => array('help' => 'Usage: %CMD%. Print statistics about the bots uptime.', 'out' => 'This bot is running since %s. Total runtime: %s.')); $plugin = Dog::getPlugin(); if ($plugin->argc() > 0) { $plugin->showHelp(); } else { $uptime = round(Dog_Init::getUptime()); $total = GWF_Counter::getCount('dog_uptime') + $uptime; $plugin->rply('out', array(GWF_Time::humanDuration($uptime), GWF_Time::humanDuration($total))); }
public function on_links_Pb() { $votes = GWF_Counter::getCount('dog_linkvotes'); $links = GDO::table('Dog_Link'); $count = $links->countRows(); $this->rply('stats', array($count, $votes, $links->selectVar('MAX(link_id)'))); }
<?php chdir('../../../'); define('GWF_PAGE_TITLE', 'The Last Hope'); require_once 'challenge/html_head.php'; require GWF_CORE_PATH . 'module/WeChall/solutionbox.php'; if (false === ($chall = WC_Challenge::getByTitle(GWF_PAGE_TITLE))) { $chall = WC_Challenge::dummyChallenge(GWF_PAGE_TITLE, 4, 'challenge/bsdhell/thelasthope/index.php', false); } $chall->showHeader(); if (strcasecmp(Common::getPost('answer'), 'username_password') === 0) { $count = GWF_Counter::getCount('WC_BSD_LH_DOLT'); if (false === GWF_Session::getOrDefault('WC_BSD_LH_DOLT', false)) { $count++; GWF_Counter::saveCounter('WC_BSD_LH_DOLT', $count); GWF_Session::set('WC_BSD_LH_DOLT', '1'); } echo GWF_HTML::message('The Last Hope', $chall->lang('msg_literal'), false); echo GWF_HTML::error('The Last Hope', $chall->lang('err_literal', array($count)), false); } else { $chall->onCheckSolution(); } htmlTitleBox($chall->lang('title'), $chall->lang('info', array('bsd_thelasthope.elf'))); formSolutionbox($chall); echo $chall->copyrightFooter(); require_once 'challenge/html_foot.php';
public function on_quotes_Pb() { $votes = GWF_Counter::getCount('dog_quotevotes'); $quotes = GDO::table('Dog_Quote'); $count = $quotes->countRows(); $last = $quotes->selectFirstObject('*', '', 'quot_date DESC'); $last = $last === false ? '' : sprintf(' The last quote has been added by %s at %s.', $last->getVar('quot_username'), $last->displayDate()); Dog::reply(sprintf('I have %d quotes in the database.%s The quotes have been voted %d times.', $count, $last, $votes)); }