0 Usuarios y 1 Visitante están viendo este tema.
<?php //=============================================================================== //=========================== Debug Codes For The Bot =========================== //=============================================================================== //$this->AddHook('DebugInfos', 'GetInfosDebug'); //$this->AddHook('DebugInfos', 'DebuginPlugin'); function GetInfosDebug($bot) { if ($bot->firstrun) { $bot->Debug($bot->cfg->_value, 'tmp_dir\Debug\bot-cfg-_value.txt', 'bot->cfg->_value'); $bot->Debug($bot->xmlsOb->xml, 'tmp_dir\Debug\bot-xmlsOb-xml.txt', 'bot->cfg->_value', 1); $obj = new Obj($bot, NULL); foreach ($bot->fobjects as $obj_) { $obj->ChangeObj($obj_); $obj->GetDataInspection(); } } } function DebuginPlugin($bot) { /* $fl = fopen('tmp_dir\Debug\building.txt', 'w'); $obj = new Obj($bot, NULL); foreach ($bot->fobjects as $obj_) { $obj->ChangeObj($obj_); $spe = $obj->GetSpecification(); if ($spe == 'building') { $data = $obj->GetStateData(); $rt = $data['ud']; $pt = (int)($obj->obj['id']/1000.0/60); fwrite($fl, 'itemName : '.$obj->GetName().' state : '.$obj->obj['state'].' rt (min) : '.$rt.' pt (min) : '.$pt."\r\n"); } } $fl = fopen('tmp_dir\Debug\All Empires & Allies.txt', 'w'); foreach ($bot->xmlsOb->xml->items->item as $obj) { if ($obj['className'] == 'Building') fwrite($fl, 'itemName : '.$obj['itemName']."\r\n"); } fclose($fl); $fl = fopen('tmp_dir\Debug\All E & A -Buildings.txt', 'w'); foreach ($bot->xmlsOb->gsXML->items->item as $obj) { if ($obj['className'] == 'Building') fwrite($fl, 'itemName : '.$obj['itemName']."\r\n"); } fclose($fl);*/ } //=============================================================================== //===================== Full Your Energy From The Inventory ===================== //=============================================================================== $this->AddHook('FullEnergy', 'FullYEnergy'); function FullYEnergy($bot) { if ($bot->firstrun)/**/{ return; } $sdata = $bot->ld->GetPlSettings("MultiFullEnergy");//sdata; if((int)$sdata->MultiFullEnergy <> 0)/*Settings*/return; if((int) $sdata->FullEnergyR == 1) { $bot->SendMsg('----Start to full with energy----');//OK; if (isset($bot->error_msg )) { $bot -> ReloadConfig(); } $timeis00 = time(); $energy00 = $bot->energy; $Energy = $sdata->obj; $eaaobj = (int)$sdata->ManyEn; $bot->SendMsg('Get ' . $eaaobj . " " . $Energy . '...'); $energyArray=array('EN1','EN2','EN3','EN4','EN5','EN6'); $CheckEnergy=false; foreach($bot->cfg->_value['data'][0]['data']['userInfo']['player']['inventory']['items'] as $code=>$nb) { if (in_array($code, $energyArray)) { $CheckEnergy=true;// If nothing in inv -> BREAK; break; } } // If load all settings right... continue ( success ); if (!$CheckEnergy) { $bot->SendMsg("No $Energy found in your inventory"); $bot->SendMsg('----Finish to full with energy----'); return; } for( $n=0; $n<$eaaobj; $n++ ) { $bot->GetEnergy($Energy); // Get energy from inventory.; if ($bot->energy >= $bot->energyMax)//If Energy is full; { $bot->SendMsg("Your energy is full not add more!!"); $bot->SendMsg('----Finish to full with energy----'); return; } // foreach($bot->cfg->_value['data'][0]['data']['userInfo']['player']['inventory']['items'] as $code=>$nb) if(isset($bot->error_msg)) { $bot->SendMsg("Some problem(s) with to get energy"); return; } $bot->SendMsg("Get the energy from inventory(Success)"); sleep(1); $bot->SendMsg("Get (". ($n+1) .") of ($eaaobj) Energy"); } $bot->ReloadConfig(); // Reload the settings from inv... $tim1 = time()-$timeis00; $ene = $bot->energy-$energy00; $bot->SendMsg("Get more $ene Energy in $tim1 seconds."); $bot->SendMsg('----Finish to full with energy----');//1; return; } } //End funtion for Energy... //=============================================================================== //=================== Get Xp And Coin With the Ship Hack Fast =================== //=============================================================================== $this->AddHook('GetCoins&Xp', 'GetLevelCoin'); function GetLevelCoin($bot) { if ($bot->firstrun)/**/ { return; } $sdata = $bot->ld->GetPlSettings("MultiXpAndCoins1"); if((int)$sdata->MultiXpAndCoins1 <> 0)/**/return; if((int) $sdata->GetXpCoins == 1) { $bot->SendMsg("----Start to get xp and coins----"); if(isset($bot->error_msg)){ $bot->ReloadConfig(); } $rep = Array();#Set Drydocks,Barracks,Hangar Array; $gmi_bu1 = array("Drydocks", "Barracks", "Hangar"); $res= $bot->ld->GetSelect("select * from objects"); $gmi_test_break = 999999; $gmi_count_found_man = 0; $eaaobj = $sdata->Cycles; $gmi_suc_cnt_actions = 0; for($n=0; $n<$eaaobj; $n++){ foreach($res as $val){ $timestart = time(); $v =(string)$val[1]; $obj= unserialize(base64_decode($v)); // base64_dec if ($obj['className'] == 'Item') $ActXp = $bot->xp; { $gmi_building = $obj['itemName']; // $obj['id'] if (in_array(strtok($gmi_building, " "), $gmi_bu1)) { $gmi_count_found_man++; if ($gmi_test_break >= $gmi_count_found_man)# Load; { $bot->SendMsg("Collecting building: ".$gmi_building);//gmi_building; $gmi_state = $obj['state']; if($gmi_state == '10') { $bot->gmi_ok($obj,$gmi_building,$obj['id'],$obj['position']);//Gmi0; usleep(1.000); if (!isset($bot->error_msg)) { $bot->gmi_actions($obj,$gmi_building,$obj['id'],$obj['position']);#1 } else // Follow that message if get error (Failed); { $bot->SendMsg("Failed! resting for 2seconds"); usleep(1.000); } } // End here after 2 seconds if have get Failed!; elseif($gmi_state == '9') { $bot->gmi_ok($obj,$gmi_building,$obj['id'],$obj['position']);//Gmi_2 usleep(1.000); if (!isset($bot->error_msg)) { $bot->gmi_actions($obj,$gmi_building, $obj['id'], $obj['position']); } else { $bot->SendMsg("Failed to gather / reset the building not start..."); } } elseif ($gmi_state == '8') { $bot->gmi_ok($obj,$gmi_building,$obj['id'],$obj['position']);//Work; usleep(1.000); $bot->gmi_actions($obj,$gmi_building, $obj['id'], $obj['position']); } else { // $bot->SendMsg("[".$gmi_count_found_man."] NAME: ".$gmi_building); $gmi_count_found_man--; } if(!isset($bot->error_msg)) { usleep(1.000); $gmi_suc_cnt_actions++; } else { $iii = 5; $bot->SendMsg("Error with the plugin settings wait to reload!!"); $bot->ReloadConfig(); while ($iii > 0) { sleep(1); $iiii = str_repeat("", $iii); $bot->SendMsg("-".$iiii."Waiting to reload! (".$iii." Seconds)"); $iii--; } if ($gmi_errors >= 2) { $bot->ReloadConfig(); $bot->SendMsg("Break the bot for error, retrying again shortly"); break; } else { $gmi_errors++; } //$bot->SendMsg("Load the settings in log faster and better ok!); } } else { //$bot->SendMsg("[".$gmi_count_found_man."] ok: ".$gmi_building); break; } } $gmi_count++; } } //$bot->SendMsg("Gathered ".$gmi_suc_cnt_actions." of ".$gmi_count_found_man." Building match"); $CompleteCycle+=1; $bot->SendMsg("Complete ($CompleteCycle) of ($eaaobj) Cycle");// Continue ok; $gmi_count_found_man = 0; $timeend = time(); $timetotal = $timeend-$timestart; if ($timetotal < 7) { $bot->SendMsg("Wait " .(7-$timetotal). " seconds to load settings..."); // Load from start; sleep((7-$timetotal)); } } $bot->ReloadConfig(); $FinFinalXpToCollect = $bot->xp-$ActXp;//$xp - $ActXp; $bot->SendMsg("------------------------------------"); $bot->SendMsg(" - GET MORE $FinFinalXpToCollect XP."); $bot->SendMsg("------------------------------------"); $bot->SendMsg("---Finish to get xp and coins---");#FN; } } // Finish to get xp and coins... //=============================================================================== //================= Select What Building Do You Like And Get It ================= //=============================================================================== $this->AddHook('GetItemsEA', 'PlaceBuilding'); function PlaceBuilding($bot) { if ($bot->firstrun) /**/ { return; } $sdata = $bot->ld->GetPlSettings("Multiplacebuilding"); if((int)$sdata->Multiplacebuilding <> 0)/**/return; if ((int) $sdata->Selectbuild == 1) { $bot->SendMsg('---Start to get E&A building---'); if(isset($bot->error_msg)){$bot->ReloadConfig();} $bot->ReloadConfig(); $item2 = $sdata->Itemname3; $eaaobj=(int)$sdata->Itemmany1;//Complete success $bot->SendMsg('Get ' .$eaaobj." ".$item2. '...'); $bot->ReloadConfig();for($n=0; $n<$eaaobj; $n++){ $bot->GetPosToPlaceTheItem($item2);//Positions OK for( $x = 63; $x<66; $x++ ) // fixed position between (63,50,0) and (65,68,0) for placement { for( $y = 50; $y<69; $y++ ) // fixed position between (63,50,0) and (65,68,0) for placement { if( $map[$x][$y] != 1 ) { $x2=$x; $y2=$y; $x=66; $y=69; $map[$x2][$y2]=1; } } } $tmp['itemName'] = $ItemNameOK; $tmp['id'] = 0; $tmp['position'] = "$x2,$y2,0"; $Continue+=1; /*OK*/ $ids[]=$bot->GetItems($tmp,$item2); $bot->SendMsg('Place (' . $Continue . ') = ' . $item2 ); if ($Continue == 10) //$bot->ReloadConfig("Success Ok"); {$bot->SendMsg('Wait to load...'); /*Reload*/ sleep(1);} if ($tmp['position'] == '65,68,0'){// Position (65,68,0) $bot->SendMsg('Stop! (If continue will get error)');#Ok; $bot->SendMsg('----Finish to get E&A building----');#Ok; return;} } // Finish the plugin settings now ("Load"). $bot->SendMsg('------Finish to get E&A building------'); } }// End function here... //=============================================================================== //=================== Select item(s) and get it. Not work all =================== //=============================================================================== $this->AddHook('GetBuildingsEA', 'SelectSItems'); function SelectSItems($bot) { if ($bot->firstrun)/**/ { return; } $sdata = $bot->ld->GetPlSettings("MultiSelectItems"); if((int)$sdata->MultiSelectItems <> 0)/**/return; if ((int) $sdata->SelectItem == 1) { $bot->SendMsg('-----Start to get E&A Item-----'); if(isset($bot->error_msg)){$bot->ReloadConfig();} $bot->ReloadConfig(); $item2 = $sdata->Itemname1; $eaaobj=(int)$sdata->Itemmany;// Complete success $bot->SendMsg('Get ' .$eaaobj." ".$item2. '...'); $bot->ReloadConfig();for($n=0; $n<$eaaobj; $n++){ $bot->GetPosToPlaceTheItem($item2);//Positions OK for( $x = 63; $x<66; $x++ ) // fixed position between (63,50,0) and (65,68,0) for placement { for( $y = 50; $y<69; $y++ ) // fixed position between (63,50,0) and (65,68,0) for placement { if( $map[$x][$y] != 1 ) { $x2=$x; $y2=$y; $x=66; $y=69; $map[$x2][$y2]=1; } } } $tmp['itemName'] = $ItemNameOK; $tmp['id'] = 0; $tmp['position'] = "$x2,$y2,0"; $Continue+=1; /*OK*/ $ids[]=$bot->GetItems($tmp,$item2); $bot->SendMsg('Place (' . $Continue . ') = ' . $item2 ); if ($Continue == 10) //$bot->ReloadConfig("Success Ok"); {$bot->SendMsg('Wait to load...'); /*Reload*/ sleep(1);} if ($tmp['position'] == '65,68,0'){// Position (65,68,0) $bot->SendMsg('Stop! (If continue will get error)');#Ok; $bot->SendMsg('------Finish to get E&A Item------');#Ok; return;} } // Finish the plugin settings now ("Load"). $bot->SendMsg('------Finish to get E&A Item------');#Ok; } }// End function here... //=============================================================================== //================ Download Image-s From Server E&A Button Check ================ //=============================================================================== $this->AddHook('download_images', 'GetImages'); function GetImages($bot) { // This function is the get the images from the Empire and Allies server // So we can use them in the plugins. $Name = "Multi"; $Version = "1.2"; $Date = "2011-??-??"; $bot->ld->UpdatePluginVersion($bot,$Name,$Version,$Date); $data = (array) $bot->ld->GetPlSettings("ImageDownload"); $save = "N"; if (!isset($data['DownloadTime'])){ $data['DownloadTime'] = ""; $save = "Y";} if (!isset($data['GameVersions'])){ $data['GameVersions'] = ""; $save = "Y";} if ($data['reset'] == "10") { $bot->SendMsg('Images reset activated.'); $bot->ld->GetOne("UPDATE Image SET download = 'N' WHERE download = 'Y'"); $data['GameVersion'] = ""; $data['reset'] = "1"; $save = "Y"; } if($save == "Y") { $bot->ld->SavePlSettings("ImageDownload", $data); } } // Finish function here... //=============================================================================== //================ Refresh The Plugin Action Run Faster & Better ================ //=============================================================================== $this->AddHook('other_work', 'RefreshAction'); function RefreshAction($bot) { if ($bot->firstrun) { // Not work if first bot cycle. return; } $bot->pm->RefreshMePlugin("Multi"); } ?>
hola no se a uds. pero a mi me salta error en linea 444Parse error: syntax error, unexpected $end in C:\Archivos de programa\EAABot\Plugins\Multi\Hooks.php on line 444
La carpeta esta pero tengo un .php con ese nombre ¿Que hago?.
Perdon, tenia un error el codigo porque habia un filtro en el foro que cambiaba este caracter " ? " el signo de iterrogacion lo cambiaba por la palabra hola y ello deformaba el código , ya se corrigio el filtro y con ello se normalizó el código, pruebenlo
Pero con el nuevo multi 13 da error....