private function cron_type($type) { $msg = self::getmsg($this->bduss[0], $type); $db_pid = get_pid($type); set_pid($msg[0]['post_id'], $type); foreach ($msg as $k) { $content = ''; $this->rand_bduss(); $this->getkwdata($k['fname']); if ($db_pid == $k['post_id']) { break; } if (@stristr($this->setting[3], $k['replyer']['name_show']) === false && @stristr($this->setting[4], $k['fname']) === false) { if ($this->setting[5] == 1) { if ($this->kwdata['user_info']['is_sign_in'] == 0) { $this->likekw($k['fname']); set_log($this->signkw($k['fname'])); } } if ($k['is_floor'] == 1) { $pid = $this->floorpid($k['thread_id'], $k['post_id']); $content = "回复 {$k['replyer']['name_show']} :"; } else { $pid = $k['post_id']; } $content .= talk($k['content'], $this->un, $this->setting[1], $this->setting[2]) . $this->setting[6]; $res = $this->reply($k['thread_id'], $pid, $k['fname'], $content); echo "在{$k['fname']}吧贴号{$k['thread_id']}{$res}"; set_log("在{$k['fname']}吧贴号{$k['thread_id']}{$res}"); // 回帖间隔 sleep(3); } } }
} return; } if ($_GET['do'] == 'editrobot') { if (empty($_GET['bduss'])) { echo '请输入BDUSS'; return; } elseif (empty($_GET['id'])) { echo '请输入ID'; return; } elseif (tieba::islogin($_GET['bduss']) === false) { echo '无效的BDUSS'; return; } else { $name = tieba::getun($_GET['bduss']); if (empty($name)) { echo '无法获取百度ID'; return; } if ($_GET['id'] == 1) { set_pid(tieba::getpid($_GET['bduss'], 'reply'), 'reply'); set_pid(tieba::getpid($_GET['bduss'], 'at'), 'at'); } if (set_robot($_GET['id'], $name, $_GET['bduss']) === true) { echo '更新成功'; } else { echo '更新失败'; } } } /*PHP END*/