* Print final messages and exit the script, conversion has completed. */ print "\n"; print "The skill database has been [1;32msuccessfully[0m converted to Hercules' libconfig\n"; print "format and has been saved as '" . DIRPATH . "skill_db.conf'.\n"; print "The following files are now deprecated and can be deleted -\n"; print DIRPATH . "skill_db.txt\n"; print DIRPATH . "skill_cast_db.txt\n"; print DIRPATH . "skill_castnodex_db.txt\n"; print DIRPATH . "skill_require_db.txt\n"; print DIRPATH . "skill_unit_db.txt\n"; $putsk .= ")"; $skconf = "skill_db.conf"; file_put_contents(DIRPATH . $skconf, $putsk); if ($debug) { print "[0;34m[Debug][0;0m Memory after converting: " . print_mem() . "\n"; print "[0;34m[Debug][0;0m Execution Time : " . (microtime_float() - $t_init) . "s\n"; } fclose($skmain); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Functions /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return (double) $usec + (double) $sec; } function show_status($done, $total) { $perc = floor($done / $total * 100); $perc = floor($perc / 2);
* Print final messages and exit the script, conversion has completed. */ print "\n"; print "The skill database has been successfully converted to Hercules' libconfig\n"; print "format and has been saved as '" . DIRPATH . "skill_db.conf'.\n"; print "The following files are now deprecated and can be deleted -\n"; print DIRPATH . "skill_db.txt\n"; print DIRPATH . "skill_cast_db.txt\n"; print DIRPATH . "skill_castnodex_db.txt\n"; print DIRPATH . "skill_require_db.txt\n"; print DIRPATH . "skill_unit_db.txt\n"; $putsk .= ")"; $skconf = "skill_db.conf"; file_put_contents(DIRPATH . $skconf, $putsk); if ($debug) { print "[Debug] Memory after converting: " . print_mem() . "\n"; print "[Debug] Execution Time : " . (microtime_float() - $t_init) . "s\n"; } fclose($skmain); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* Functions /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return (double) $usec + (double) $sec; } function show_status($done, $total) { $perc = floor($done / $total * 100); $perc = floor($perc / 2);