private function appendText($texto) { // OJO para agregar texto invoca $obj->addAtributo('_textAfter','El texto a ser agregado') if (!is_string($texto)) { throw new RuntimeException('No se puede agregar un texto que no es un string'); } if ($this->self_close) { throw new RuntimeException('Este elemento no puede tener texto. (' . $this - getAtributo('tag') . ')'); } $this->text_after .= $texto; }
function escanearFlotas() { $pagina = $this->leerMenu('principal'); $DOM = leerStringHTML($pagina); $scripts = getElementos($DOM, "script"); $siguiente = false; foreach ($scripts as $script) { if ($siguiente) { $stringScript = $DOM->saveHTML($script); $zonaFlotas = get_string_between($stringScript, "reloadEventbox({", ",});}"); $recibiendoAtaque = $this->getDatosEventoFlota($zonaFlotas); if (!$recibiendoAtaque) { $this->finColas["vigilancia"] = time() + genNumRandRadio(7 * 60, 0.4); $this->ataque = false; } else { $this->finColas["vigilancia"] = time() + $recibiendoAtaque["tiempo"]; if ($recibiendoAtaque["hostil"]) { $this->finColas["defensa"] = $this->finColas["vigilancia"]; $this->finColas["vigilancia"] -= 10; } report('err', "Se ha detectado un ataque al planeta..."); report('err', $zonaFlotas); $this->ataque = true; } break; } if (equals(getAtributo($script, "src"), 'http://gf3.geo.gfsrv.net/cdn5f/499f4473789223147dffc57161df54.js')) { // coger el script siguiente al que tiene ese src $siguiente = true; } } /* MANDANDO FLOTA: {reloadEventbox({"hostile":0,"neutral":0,"friendly":1,"eventTime":564,"eventText":"Transporte","eventType":"undermark"});} VOLVIENDO FLOTA: {reloadEventbox({"hostile":0,"neutral":0,"friendly":1,"eventTime":525,"eventText":"Transporte (R)","eventType":"undermark"});} ATACANDO A OTRO PLANETA: {reloadEventbox({"hostile":0,"neutral":0,"friendly":1,"eventTime":566,"eventText":"Atacar","eventType":"undermark"});} */ }