$function_vars['general_config']['primary_instance'] = false; } if ($function_vars['general_config']['enable'] && $function_vars['general_config']['primary_instance']) { $instance_list[0]['functions'][] = $function_name; $instance_list[0]['weight'] += $function_vars['general_config']['weight']; if ($general_config['multibot_config']['protect_primary_instance']) { $instance_list[0]['weight'] += 1000; } } elseif ($function_vars['general_config']['enable']) { $index = getSmallerIndex($instance_list); $instance_list[$index]['functions'][] = $function_name; $instance_list[$index]['weight'] += $function_vars['general_config']['weight']; } } foreach ($instance_list as $instance) { $multibotObject->createInstance($instance); } } else { $multibotObject->addInfo($lang['commands_mode']['only_commands']); } //***************************************************************************** //*********************************** Loop ************************************ //***************************************************************************** $tsAdminSocket = $multibotObject->getTsAdminSocket(); $whoAmi_timer = date('r', time() + 120); sendCommand("servernotifyregister event=textprivate"); while (true) { $socket_data = getData(); if (is_array($socket_data) && !empty($socket_data)) { if (array_key_exists("notifytextmessage", $socket_data)) { sendCommand("servernotifyunregister");
} } elseif ($vars['enable']) { $index = getSmallerIndex($instanceList); $instanceList[$index]['functions'][] = $name; $instanceList[$index]['weight'] += $vars['weight']; } } foreach ($instanceList as $instances) { foreach ($instances['functions'] as $functionName) { if (isset($functions) && !empty($functions)) { $functions .= "," . $functionName; } else { $functions = $functionName; } } $commands->createInstance($functions, $instances['weight']); unset($functions); } // Pętla sprawdzająca wpisywane dane $timer = date('r', time() + 120); sendCommand("servernotifyregister event=textserver"); sendCommand("servernotifyregister event=textprivate"); while (true) { $r = getData(); if (is_array($r) && !empty($r)) { if (array_key_exists("notifytextmessage", $r)) { if ($r['targetmode'] == 3 && "!" == substr($r['msg'], 0, 1)) { $r['msg'] = str_replace("!", "", $r['msg']); sendCommand("servernotifyunregister"); $commands->executeCommand($r, true); sendCommand("servernotifyregister event=textserver");